|
def | __init__ (self, name, tf_activation_str, dim_input, dim_output, p_bias, p_w, random_seed=None) |
|
def | __call__ (self, x) |
|
def | variable_to_summary (self, var, step, writer) |
|
def | all_to_summary (self, step, writer) |
|
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, |
|
|
|
random_seed = None |
|
) |
| |
:param name: name of the layer.
:param tf_activation: string, name of an available tensorflow activations function
:param dim_input: dimension of the input
:param dim_output: dimension of the output
:param p_bias: initial bias
:param p_w: stddev of uniform distribution to initialize
:param random_seed: random seed used in initialising the weights
:return: None
Definition at line 26 of file tensorflow_dnn_model.py.
29 :param name: name of the layer.
30 :param tf_activation: string, name of an available tensorflow activations function
31 :param dim_input: dimension of the input
32 :param dim_output: dimension of the output
33 :param p_bias: initial bias
34 :param p_w: stddev of uniform distribution to initialize
35 :param random_seed: random seed used in initialising the weights
39 super().__init__(name=name)
41 tf_activation_dict = {
43 'sigmoid': tf.nn.sigmoid,
45 'leaky_relu': tf.nn.leaky_relu,
48 if tf_activation_str
not in tf_activation_dict:
52 self.tf_activation = tf_activation_dict[tf_activation_str]
55 self.shape = [dim_input, dim_output]
58 self.w = self._init_weight(self.shape, p_w, random_seed)
61 self.b = self._init_bias(self.shape[1], p_bias)
◆ __call__()
◆ _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 |
◆ all_to_summary()
def all_to_summary |
( |
|
self, |
|
|
|
step, |
|
|
|
writer |
|
) |
| |
◆ variable_to_summary()
def variable_to_summary |
( |
|
self, |
|
|
|
var, |
|
|
|
step, |
|
|
|
writer |
|
) |
| |
◆ tf_activation
The documentation for this class was generated from the following file: