Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def build(self, graph=None, optimizer=None):
- """
- Creates model graph and groups important variables into named collections.
- """
- if graph is None:
- graph = tf.Graph()
- with graph.as_default():
- inputs = create_inputs()
- logits = build_model(
- inputs=inputs.x,
- layers=self.hidden_layers,
- n_outputs=self.n_classes,
- activation=self.activation)
- training_op, metrics = create_optimizer(
- labels=inputs.y,
- logits=logits,
- opt_cls=optimizer)
- add_to_collection('inputs', *inputs)
- add_to_collection('metrics', *metrics)
- add_to_collection('training', logits, training_op)
- self._graph = graph
Add Comment
Please, Sign In to add comment