Esempio n. 1
0
    if (delta >= 0):
        return (bcolors.OKGREEN + format(cur_val, ".3f") + bcolors.ENDC)
    else:
        return (bcolors.FAIL + format(cur_val, ".3f") + bcolors.ENDC)


# Parse args.
args = docopt(__doc__)
# Save data to an output dir.
outdir = os.path.expanduser(args['--outdir'])
output_path = os.path.join(outdir, time.strftime('%Y_%m_%d__%H_%M_%S_%p'))
if not os.path.exists(output_path):
    os.makedirs(output_path)

# -------- Load all data --------
train_data = TrainingData.fromfilename("train", args['--indir'])
test_data = TrainingData.fromfilename("test", args['--indir'])

numTest = 8000
skipTest = 1
if config.running_on_laptop:
    numTest = 384 * 2
    skipTest = 4
test_data.TrimArray(numTest, skipTest)

net_model = NNModel()

timeStamp = time.strftime("%Y_%m_%d__%H_%M_%S")

# Add ops to save and restore all the variables.
saver = tf.train.Saver()
Esempio n. 2
0
    else:
        return format(s, format_str)


# Parse args.
args = docopt(__doc__)
# Save data to an output dir.
outdir = os.path.expanduser(args['--outdir'])
output_path = os.path.join(outdir, time.strftime('%Y_%m_%d__%H_%M_%S_%p'))
if not os.path.exists(output_path):
    os.makedirs(output_path)

print("Tensorflow version: " + tf.__version__)

# -------- Load all data --------
train_data = TrainingData.fromfilename("train", args['--indir'])
test_data = TrainingData.fromfilename("test", args['--indir'])
print("In dir: {}".format(args["--indir"]))

if config.neural_net_mode == 'alexnet':
    net_model = NNModel()
elif config.neural_net_mode == 'lstm':
    net_model = LSTMModel()
else: assert False  # Bad training mode in config.py.

numTest = 8000
skipTest = 1
if config.running_on_laptop:
    numTest = 8500# 384 * 8
    skipTest = 1
test_data.TrimArray(numTest, skipTest)