-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathflags.py
More file actions
84 lines (61 loc) · 2.84 KB
/
flags.py
File metadata and controls
84 lines (61 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
from __future__ import division
import os
from os.path import join as pjoin
import sys
import tensorflow as tf
IMAGE_PIXELS = 28 * 28
NUM_CLASSES = 10
def home_out(path):
return pjoin(os.environ['HOME'], 'tmp', 'mnist', path)
flags = tf.app.flags
FLAGS = flags.FLAGS
# Autoencoder Architecture Specific Flags
flags.DEFINE_integer("num_hidden_layers", 3, "Number of hidden layers")
flags.DEFINE_integer('hidden1_units', 2000,
'Number of units in hidden layer 1.')
flags.DEFINE_integer('hidden2_units', 2000,
'Number of units in hidden layer 2.')
flags.DEFINE_integer('hidden3_units', 2000,
'Number of units in hidden layer 3.')
flags.DEFINE_integer('image_pixels', IMAGE_PIXELS, 'Total number of pixels')
flags.DEFINE_integer('num_classes', 10, 'Number of classes')
flags.DEFINE_float('pre_layer1_learning_rate', 0.0001,
'Initial learning rate.')
flags.DEFINE_float('pre_layer2_learning_rate', 0.0001,
'Initial learning rate.')
flags.DEFINE_float('pre_layer3_learning_rate', 0.0001,
'Initial learning rate.')
flags.DEFINE_float('noise_1', 0.50, 'Rate at which to set pixels to 0')
flags.DEFINE_float('noise_2', 0.50, 'Rate at which to set pixels to 0')
flags.DEFINE_float('noise_3', 0.50, 'Rate at which to set pixels to 0')
# Constants
flags.DEFINE_integer('seed', 1234, 'Random seed')
flags.DEFINE_integer('image_size', 28, 'Image square size')
flags.DEFINE_integer('batch_size', 100,
'Batch size. Must divide evenly into the dataset sizes.')
flags.DEFINE_float('supervised_learning_rate', 0.1,
'Supervised initial learning rate.')
flags.DEFINE_integer('pretraining_epochs', 60,
"Number of training epochs for pretraining layers")
flags.DEFINE_integer('finetuning_epochs', 56,
"Number of training epochs for "
"fine tuning supervised step")
flags.DEFINE_float('zero_bound', 1.0e-9,
'Value to use as buffer to avoid '
'numerical issues at 0')
flags.DEFINE_float('one_bound', 1.0 - 1.0e-9,
'Value to use as buffer to avoid numerical issues at 1')
flags.DEFINE_float('flush_secs', 120, 'Number of seconds to flush summaries')
# Directories
flags.DEFINE_string('data_dir', home_out('data'),
'Directory to put the training data.')
flags.DEFINE_string('summary_dir', home_out('summaries'),
'Directory to put the summary data')
flags.DEFINE_string('chkpt_dir', home_out('chkpts'),
'Directory to put the model checkpoints')
# TensorBoard
flags.DEFINE_boolean('no_browser', True,
'Whether to start browser for TensorBoard')
# Python
flags.DEFINE_string('python', sys.executable,
'Path to python executable')