[259458]: / Models / Initialize_Variables / Initialize.py

Download this file

20 lines (12 with data), 366 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Import useful packages
import tensorflow as tf
# Initialize the Weights
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.01)
return tf.Variable(initial)
# Initialize the Bias
def bias_variable(shape):
initial = tf.constant(0.01, shape=shape)
return tf.Variable(initial)