class_docstr: Gaussian LSTM Model.
  
  A model represented by a Gaussian distribution
  which is parameterized by a Long short-term memory (LSTM).
  
  Args:
      output_dim (int): Output dimension of the model.
      hidden_dim (int): Hidden dimension for LSTM cell for mean.
      name (str): Model name, also the variable scope.
      hidden_nonlinearity (callable): Activation function for intermediate
          dense layer(s). It should return a tf.Tensor. Set it to
          None to maintain a linear activation.
      hidden_w_init (callable): Initializer function for the weight
          of intermediate dense layer(s). The function should return a
          tf.Tensor.
      hidden_b_init (callable): Initializer function for the bias
          of intermediate dense layer(s). The function should return a
          tf.Tensor.
      recurrent_nonlinearity (callable): Activation function for recurrent
          layers. It should return a tf.Tensor. Set it to None to
          maintain a linear activation.
      recurrent_w_init (callable): Initializer function for the weight
          of recurrent layer(s). The function should return a
          tf.Tensor.
      output_nonlinearity (callable): Activation function for output dense
          layer. It should return a tf.Tensor. Set it to None to
          maintain a linear activation.
      output_w_init (callable): Initializer function for the weight
          of output dense layer(s). The function should return a
          tf.Tensor.
      output_b_init (callable): Initializer function for the bias
          of output dense layer(s). The function should return a
          tf.Tensor.
      hidden_state_init (callable): Initializer function for the
          initial hidden state. The functino should return a tf.Tensor.
      hidden_state_init_trainable (bool): Bool for whether the initial
          hidden state is trainable.
      cell_state_init (callable): Initializer function for the
          initial cell state. The functino should return a tf.Tensor.
      cell_state_init_trainable (bool): Bool for whether the initial
          cell state is trainable.
      forget_bias (bool): If True, add 1 to the bias of the forget gate at
          initialization. It's used to reduce the scale of forgetting at the
          beginning of the training.
      learn_std (bool): Is std trainable.
      init_std (float): Initial value for std.
      std_share_network (bool): Boolean for whether mean and std share
          the same network.
      layer_normalization (bool): Bool for using layer normalization or not.
class_docstr_tok: ["Gaussian","LSTM","Model",".","A","model","represented","by","a","Gaussian","distribution","which","is","parameterized","by","a","Long","short-term","memory","(","LSTM",")",".","Args",":","output_dim","(","int",")",":","Output","dimension","of","the","model",".","hidden_dim","(","int",")",":","Hidden","dimension","for","LSTM","cell","for","mean",".","name","(","str",")",":","Model","name",",","also","the","variable","scope",".","hidden_nonlinearity","(","callable",")",":","Activation","function","for","intermediate","dense","layer","(","s",")",".","It","should","return","a","tf.Tensor",".","Set","it","to","None","to","maintain","a","linear","activation",".","hidden_w_init","(","callable",")",":","Initializer","function","for","the","weight","of","intermediate","dense","layer","(","s",")",".","The","function","should","return","a","tf.Tensor",".","hidden_b_init","(","callable",")",":","Initializer","function","for","the","bias","of","intermediate","dense","layer","(","s",")",".","The","function","should","return","a","tf.Tensor",".","recurrent_nonlinearity","(","callable",")",":","Activation","function","for","recurrent","layers",".","It","should","return","a","tf.Tensor",".","Set","it","to","None","to","maintain","a","linear","activation",".","recurrent_w_init","(","callable",")",":","Initializer","function","for","the","weight","of","recurrent","layer","(","s",")",".","The","function","should","return","a","tf.Tensor",".","output_nonlinearity","(","callable",")",":","Activation","function","for","output","dense","layer",".","It","should","return","a","tf.Tensor",".","Set","it","to","None","to","maintain","a","linear","activation",".","output_w_init","(","callable",")",":","Initializer","function","for","the","weight","of","output","dense","layer","(","s",")",".","The","function","should","return","a","tf.Tensor",".","output_b_init","(","callable",")",":","Initializer","function","for","the","bias","of","output","dense","layer","(","s",")",".","The","function","should","return","a","tf.Tensor",".","hidden_state_init","(","callable",")",":","Initializer","function","for","the","initial","hidden","state",".","The","functino","should","return","a","tf.Tensor",".","hidden_state_init_trainable","(","bool",")",":","Bool","for","whether","the","initial","hidden","state","is","trainable",".","cell_state_init","(","callable",")",":","Initializer","function","for","the","initial","cell","state",".","The","functino","should","return","a","tf.Tensor",".","cell_state_init_trainable","(","bool",")",":","Bool","for","whether","the","initial","cell","state","is","trainable",".","forget_bias","(","bool",")",":","If","True",",","add","1","to","the","bias","of","the","forget","gate","at","initialization",".","It","'s","used","to","reduce","the","scale","of","forgetting","at","the","beginning","of","the","training",".","learn_std","(","bool",")",":","Is","std","trainable",".","init_std","(","float",")",":","Initial","value","for","std",".","std_share_network","(","bool",")",":","Boolean","for","whether","mean","and","std","share","the","same","network",".","layer_normalization","(","bool",")",":","Bool","for","using","layer","normalization","or","not","."]
docstr: Build model.
  
  Args:
      state_input (tf.Tensor): Entire time-series observation input,
          with shape :math:`(N, T, S^*)`.
      step_input (tf.Tensor): Single timestep observation input,
          with shape :math:`(N, S^*)`.
      step_hidden (tf.Tensor): Hidden state for step, with shape
          :math:`(N, S^*)`.
      step_cell (tf.Tensor): Cell state for step, with shape
          :math:`(N, S^*)`.
      name (str): Inner model name, also the variable scope of the
          inner model, if exist. One example is
          garage.tf.models.Sequential.
  
  Returns:
      tfp.distributions.MultivariateNormalDiag: Policy distribution.
      tf.Tensor: Step means, with shape :math:`(N, S^*)`.
      tf.Tensor: Step log std, with shape :math:`(N, S^*)`.
      tf.Tensor: Step hidden state, with shape :math:`(N, S^*)`.
      tf.Tensor: Step cell state, with shape :math:`(N, S^*)`.
      tf.Tensor: Initial hidden state, with shape :math:`(S^*)`.
      tf.Tensor: Initial cell state, with shape :math:`(S^*)`
docstr_tok: ["Build","model",".","Args",":","state_input","(","tf.Tensor",")",":","Entire","time-series","observation","input",",","with","shape",":","math",":","`","(","N",",","T",",","S^","*",")","`",".","step_input","(","tf.Tensor",")",":","Single","timestep","observation","input",",","with","shape",":","math",":","`","(","N",",","S^","*",")","`",".","step_hidden","(","tf.Tensor",")",":","Hidden","state","for","step",",","with","shape",":","math",":","`","(","N",",","S^","*",")","`",".","step_cell","(","tf.Tensor",")",":","Cell","state","for","step",",","with","shape",":","math",":","`","(","N",",","S^","*",")","`",".","name","(","str",")",":","Inner","model","name",",","also","the","variable","scope","of","the","inner","model",",","if","exist",".","One","example","is","garage.tf.models.Sequential",".","Returns",":","tfp.distributions.MultivariateNormalDiag",":","Policy","distribution",".","tf.Tensor",":","Step","means",",","with","shape",":","math",":","`","(","N",",","S^","*",")","`",".","tf.Tensor",":","Step","log","std",",","with","shape",":","math",":","`","(","N",",","S^","*",")","`",".","tf.Tensor",":","Step","hidden","state",",","with","shape",":","math",":","`","(","N",",","S^","*",")","`",".","tf.Tensor",":","Step","cell","state",",","with","shape",":","math",":","`","(","N",",","S^","*",")","`",".","tf.Tensor",":","Initial","hidden","state",",","with","shape",":","math",":","`","(","S^","*",")","`",".","tf.Tensor",":","Initial","cell","state",",","with","shape",":","math",":","`","(","S^","*",")","`"]
code: def _build(
      self, state_input, step_input, step_hidden, step_cell, name=None
  ):
      """Build model.
  
      Args:
          state_input (tf.Tensor): Entire time-series observation input,
              with shape :math:`(N, T, S^*)`.
          step_input (tf.Tensor): Single timestep observation input,
              with shape :math:`(N, S^*)`.
          step_hidden (tf.Tensor): Hidden state for step, with shape
              :math:`(N, S^*)`.
          step_cell (tf.Tensor): Cell state for step, with shape
              :math:`(N, S^*)`.
          name (str): Inner model name, also the variable scope of the
              inner model, if exist. One example is
              garage.tf.models.Sequential.
  
      Returns:
          tfp.distributions.MultivariateNormalDiag: Policy distribution.
          tf.Tensor: Step means, with shape :math:`(N, S^*)`.
          tf.Tensor: Step log std, with shape :math:`(N, S^*)`.
          tf.Tensor: Step hidden state, with shape :math:`(N, S^*)`.
          tf.Tensor: Step cell state, with shape :math:`(N, S^*)`.
          tf.Tensor: Initial hidden state, with shape :math:`(S^*)`.
          tf.Tensor: Initial cell state, with shape :math:`(S^*)`
  
      """
      del name
      action_dim = self._output_dim
  
      with tf.compat.v1.variable_scope("dist_params"):
          if self._std_share_network:
              # mean and std networks share an MLP
              (
                  outputs,
                  step_outputs,
                  step_hidden,
                  step_cell,
                  hidden_init_var,
                  cell_init_var,
              ) = lstm(
                  name="mean_std_network",
                  lstm_cell=self._mean_std_lstm_cell,
                  all_input_var=state_input,
                  step_input_var=step_input,
                  step_hidden_var=step_hidden,
                  step_cell_var=step_cell,
                  hidden_state_init=self._hidden_state_init,
                  hidden_state_init_trainable=self._hidden_state_init_trainable,
                  cell_state_init=self._cell_state_init,
                  cell_state_init_trainable=self._cell_state_init_trainable,
                  output_nonlinearity_layer=self._mean_std_output_nonlinearity_layer,
              )
              with tf.compat.v1.variable_scope("mean_network"):
                  mean_var = outputs[..., :action_dim]
                  step_mean_var = step_outputs[..., :action_dim]
              with tf.compat.v1.variable_scope("log_std_network"):
                  log_std_var = outputs[..., action_dim:]
                  step_log_std_var = step_outputs[..., action_dim:]
  
          else:
              # separate MLPs for mean and std networks
              # mean network
              (
                  mean_var,
                  step_mean_var,
                  step_hidden,
                  step_cell,
                  hidden_init_var,
                  cell_init_var,
              ) = lstm(
                  name="mean_network",
                  lstm_cell=self._mean_lstm_cell,
                  all_input_var=state_input,
                  step_input_var=step_input,
                  step_hidden_var=step_hidden,
                  step_cell_var=step_cell,
                  hidden_state_init=self._hidden_state_init,
                  hidden_state_init_trainable=self._hidden_state_init_trainable,
                  cell_state_init=self._cell_state_init,
                  cell_state_init_trainable=self._cell_state_init_trainable,
                  output_nonlinearity_layer=self._mean_output_nonlinearity_layer,
              )
              log_std_var, step_log_std_var = recurrent_parameter(
                  input_var=state_input,
                  step_input_var=step_input,
                  length=action_dim,
                  initializer=tf.constant_initializer(
                      self._init_std_param
                  ),
                  trainable=self._learn_std,
                  name="log_std_param",
              )
  
      dist = tfp.distributions.MultivariateNormalDiag(
          loc=mean_var, scale_diag=tf.exp(log_std_var)
      )
  
      return (
          dist,
          step_mean_var,
          step_log_std_var,
          step_hidden,
          step_cell,
          hidden_init_var,
          cell_init_var,
      )
  
file_path: garage/src/garage/tf/models/gaussian_lstm_model.py
imports: import numpy
  import tensorflow
  import tensorflow_probability
  from garage.experiment import deterministic
  from garage.tf.models.lstm import lstm
  from garage.tf.models.model import Model
  from garage.tf.models.parameter import recurrent_parameter
label_desc: Use image node_id 5 for calling the GaussianLSTMModel obj's underlying member method code with example usage: obj._build(state_input, step_input, step_hidden, step_cell, name) and returns: dist,  step_mean_var,  step_log_std_var,  step_hidden,  step_cell,  hidden_init_var,  cell_init_var