mirror of
https://github.com/wassname/ray.git
synced 2026-07-19 11:27:32 +08:00
* add tf metrics * comments * fix network scopes * add doc * use format string * fix trace level * plot intermediate and final sgd stats * add back a global step
17 lines
637 B
Python
17 lines
637 B
Python
from __future__ import absolute_import
|
|
from __future__ import division
|
|
from __future__ import print_function
|
|
|
|
import tensorflow as tf
|
|
import tensorflow.contrib.slim as slim
|
|
|
|
|
|
def vision_net(inputs, num_classes=10):
|
|
with tf.name_scope("vision_net") as net:
|
|
conv1 = slim.conv2d(inputs, 16, [8, 8], 4, scope=net + "conv1")
|
|
conv2 = slim.conv2d(conv1, 32, [4, 4], 2, scope=net + "conv2")
|
|
fc1 = slim.conv2d(conv2, 512, [10, 10], padding="VALID", scope=net + "fc1")
|
|
fc2 = slim.conv2d(fc1, num_classes, [1, 1], activation_fn=None,
|
|
normalizer_fn=None, scope=net + "fc2")
|
|
return tf.squeeze(fc2, [1, 2])
|