|
def | __init__ (self, name, tf_activation_str, dim_input, dim_output, p_bias, p_w, operation_seed=None) |
|
def | initialize (self, layer_input) |
|
definition of a layer obj
Definition at line 21 of file tensorflow_dnn_model.py.
◆ __init__()
def __init__ |
( |
|
self, |
|
|
|
name, |
|
|
|
tf_activation_str, |
|
|
|
dim_input, |
|
|
|
dim_output, |
|
|
|
p_bias, |
|
|
|
p_w, |
|
|
|
operation_seed = None |
|
) |
| |
:param name:
:param tf_activation: string, name of an available tensorflow activations function
:param dim_input:
:param dim_output:
:param p_bias: initial constant
:param p_w: stddev of uniform distribution to initialize
:return:
Definition at line 26 of file tensorflow_dnn_model.py.
30 :param tf_activation: string, name of an available tensorflow activations function
33 :param p_bias: initial constant
34 :param p_w: stddev of uniform distribution to initialize
40 tf_activation_dict = {
42 'sigmoid': tf.sigmoid,
44 'leaky_relu': tf.nn.leaky_relu,
47 if tf_activation_str
not in tf_activation_dict:
51 self.tf_activation = tf_activation_dict[tf_activation_str]
57 self.shape = [dim_input, dim_output]
60 self.w = self._init_weight(self.shape, p_w, operation_seed)
63 self.b = self._init_bias(self.shape[1], p_bias)
72 self.is_initialized =
False
75 self._add_all_to_summary()
◆ _add_all_to_summary()
def _add_all_to_summary |
( |
|
self | ) |
|
|
private |
◆ _add_var_to_summary()
def _add_var_to_summary |
( |
|
self, |
|
|
|
var |
|
) |
| |
|
private |
add variables of this layer to tensorboard
:param var: tensorflow variable
:return:
Definition at line 111 of file tensorflow_dnn_model.py.
◆ _init_bias()
def _init_bias |
( |
|
self, |
|
|
|
width, |
|
|
|
init_val, |
|
|
|
name = None |
|
) |
| |
|
private |
◆ _init_weight()
def _init_weight |
( |
|
self, |
|
|
|
shape, |
|
|
|
stddev, |
|
|
|
operation_seed, |
|
|
|
name = None |
|
) |
| |
|
private |
◆ initialize()
def initialize |
( |
|
self, |
|
|
|
layer_input |
|
) |
| |
The documentation for this class was generated from the following file: