MCPcopy
hub / github.com/naturomics/CapsNet-Tensorflow / __init__

Method __init__

capsNet.py:9–27  ·  view source on GitHub ↗
(self, is_training=True)

Source from the content-addressed store, hash-verified

7
8class CapsNet(object):
9 def __init__(self, is_training=True):
10 self.graph = tf.Graph()
11 with self.graph.as_default():
12 if is_training:
13 self.X, self.Y = get_batch_data()
14
15 self.build_arch()
16 self.loss()
17
18 # t_vars = tf.trainable_variables()
19 self.optimizer = tf.train.AdamOptimizer()
20 self.global_step = tf.Variable(0, name='global_step', trainable=False)
21 self.train_op = self.optimizer.minimize(self.total_loss, global_step=self.global_step) # var_list=t_vars)
22 else:
23 self.X = tf.placeholder(tf.float32,
24 shape=(cfg.batch_size, 28, 28, 1))
25 self.build_arch()
26
27 tf.logging.info('Seting up the main structure')
28
29 def build_arch(self):
30 with tf.variable_scope('Conv1_layer'):

Callers

nothing calls this directly

Calls 3

build_archMethod · 0.95
lossMethod · 0.95
get_batch_dataFunction · 0.90

Tested by

no test coverage detected