import tensorflow as tf



def linear(x, output_layer_size, regularizer_scale=1e-8):
  return tf.contrib.layers.fully_connected(
    x,
    output_layer_size,
    activation_fn=tf.nn.elu,
    weight_regularizer=tf.contrib.layers.l2_regularizer(regularizer_scale),
  )

@@ -18,16 +18,40 @@
  as tf%0A%0A
+from . import var_init%0A%0A
 %0A%0Adef li
@@ -108,61 +108,89 @@
 :%0A  
-return tf.contrib.layers.fully_connected(%0A    x,%0A    
+weight = _weight(%5Bx.get_shape().as_list()%5B1%5D, output_layer_size%5D)%0A  bias = _bias(
 outp
@@ -206,115 +206,304 @@
 size
-,%0A    activation_fn=tf.nn.elu,%0A    weight_regularizer=tf.contrib.layers.l2_regularizer(regularizer_scale),%0A  
+)%0A  tf.add_to_collection(tf.GraphKeys.WEIGHTS, weight)%0A  tf.add_to_collection(tf.GraphKeys.BIASES, bias)%0A  return tf.matmul(x, weight) + bias%0A%0A%0Adef _weight(shape):%0A  return tf.Variable(var_init.normal(shape))%0A%0A%0Adef _bias(output_layer_size):%0A  return tf.Variable(var_init.normal(%5Boutput_layer_size%5D)
 )%0A

Implement linear layer by myself