network.py
The main function for defining the optimizer network.
-
class StandardDeepLSTM(Network)- Standard LSTM layers with a Linear layer on top.
-
Arguments:
output_size: Output sizes of the final linear layer.layers: Output sizes of LSTM layers.preprocess_name: Gradient preprocessing class name (inl2l.preprocessor tf modules). Default istf.identity.preprocess_options: Gradient preprocessing options.scale: Gradient scaling (default is 1.0).initializer: Variable initializer for linear layer. Seesnt.Linearandsnt.LSTMdocs for more info. This parameter can be a string (e.g. "zeros" will be converted to tf.zeros_initializer). name: Module name.
-
Arributes:
-
_build(self, inputs, prev_state):-
Connects the
StandardDeepLSTMmodule into the graph. -
Arguments:
inputs: 2DTensor([batch_size, input_size]).prev_state:DeepRNNstate.
-
Return:
Tensorshaped asinputs.
-
-
class CoordinateWiseDeepLSTM(StandardDeepLSTM)-
Coordinate-wise LSTM that is used in this study.
-
Arguments:
output_size: Output sizes of the final linear layer.layers: Output sizes of LSTM layers.preprocess_name: Gradient preprocessing class name (inl2l.preprocessor tf modules). Default istf.identity.preprocess_options: Gradient preprocessing options.scale: Gradient scaling (default is 1.0).initializer: Variable initializer for linear layer. Seesnt.Linearandsnt.LSTMdocs for more info. This parameter can be a string (e.g. "zeros" will be converted to tf.zeros_initializer). name: Module name.
-
Arributes:
-
_build(self, inputs, prev_state):-
Connects the CoordinateWiseDeepLSTM module into the graph.
-
Arguments:
inputs: Arbitrarily shapedTensor.prev_state:DeepRNNstate.
-
Return :
Tensorshaped asinputs.
-
-