mirror of
https://github.com/wassname/DeepRL.git
synced 2026-09-02 12:00:22 +08:00
13 lines
539 B
Python
13 lines
539 B
Python
import tensorflow as tf
|
|
|
|
def fully_connected(model_name, layer_name, var_in, dim_in, dim_out,
|
|
initializer, transfer):
|
|
with tf.variable_scope(model_name):
|
|
with tf.variable_scope(layer_name):
|
|
W = tf.get_variable("W", [dim_in, dim_out],
|
|
initializer=initializer)
|
|
b = tf.get_variable("b", [dim_out],
|
|
initializer=initializer)
|
|
net = tf.nn.bias_add(tf.matmul(var_in, W), b)
|
|
phi = transfer(net)
|
|
return W, b, net, phi |