Skip to content
Snippets Groups Projects
Commit 41668b3f authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Updated dummy net

parent 882d1245
No related branches found
No related tags found
1 merge request!21Resolve "Adopt to the Estimators API"
...@@ -4,33 +4,34 @@ ...@@ -4,33 +4,34 @@
import tensorflow as tf import tensorflow as tf
def dummy(conv1_kernel_size=3, conv1_output=1, fc1_output=2, seed=10):
def dummy(inputs, reuse=False):
""" """
Create all the necessary variables for this CNN Create all the necessary variables for this CNN
**Parameters** **Parameters**
conv1_kernel_size: inputs:
conv1_output:
fc1_output: reuse:
seed = 10
""" """
slim = tf.contrib.slim slim = tf.contrib.slim
end_points = dict() end_points = dict()
initializer = tf.contrib.layers.xavier_initializer(uniform=False, dtype=tf.float32, seed=seed)
initializer = tf.contrib.layers.xavier_initializer()
graph = slim.conv2d(inputs, conv1_output, conv1_kernel_size, activation_fn=tf.nn.relu,
stride=1, graph = slim.conv2d(inputs, 10, [3, 3], activation_fn=tf.nn.relu, stride=1, scope='conv1',
weights_initializer=initializer, weights_initializer=initializer, reuse=reuse)
scope='conv1')
end_points['conv1'] = graph end_points['conv1'] = graph
graph = slim.max_pool2d(graph, [4, 4], scope='pool1')
end_points['pool1'] = graph
graph = slim.flatten(graph, scope='flatten1') graph = slim.flatten(graph, scope='flatten1')
end_points['flatten1'] = graph end_points['flatten1'] = graph
graph = slim.fully_connected(graph, fc1_output, graph = slim.fully_connected(graph, 50,
weights_initializer=initializer, weights_initializer=initializer,
activation_fn=None, activation_fn=None,
scope='fc1') scope='fc1')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment