import sys sys.path.append('/home/annal/Izzy/vision_amt/') from Net.tensor import net3 from Net.tensor import net4 from Net.tensor import net6,net6_c,net8 from Net.tensor import inputdata from options import AMTOptions import numpy as np from scripts import compile_supervisor, merge_supervised if __name__ == "__main__": num_nets = 2 net_paths = [] for _ in range(num_nets): clean = False rand = False outfile = open(AMTOptions.amt_dir + 'deltas.txt', 'w+') merge_supervised.load_rollouts(clean, rand, (0,20), (0,-1), outfile) outfile.close() compile_supervisor.compile_reg() data = inputdata.AMTData(AMTOptions.train_file, AMTOptions.test_file,channels=3) #net = net6_c.NetSix_C() net = net6.NetSix() net_paths.append(net.optimize(50,data, batch_size=200)) train_writer = open(AMTOptions.amt_dir + 'net_cluster.txt', 'w+') for path in net_paths: train_writer.write(path + ' \n') train_writer.close()
last = args.last else: print "please enter a last value with -l (not inclusive)" sys.exit() sup = True if args.DAgger: sup = False elif args.supervisor: sup = True else: print "specify type" sys.exit() outfile = open(AMTOptions.amt_dir + 'deltas.txt', 'w+') if sup: failure = merge_supervised.load_rollouts(False, False, (first,last), (0,-1), outfile, name = person) if failure: print "did not have the sufficient rollouts specified" outfile.close() else: failure = merge_supervised.load_rollouts(False, False, (0,20), (0,-1), outfile, name = person) if failure: print "did not have the sufficient rollouts specified... Do you have at least 20 supervised rollouts" sys.exit() f = [] for (dirpath, dirnames, filenames) in os.walk(AMTOptions.rollouts_dir + person + "_rollouts/"): f.extend(filenames) for filename in f: read_path = AMTOptions.rollouts_dir + person + "_rollouts/" + filename if read_path.find("retroactive_feedback") != -1 and read_path.find("~") == -1: print filename