pydbm.rnn package

Submodules

pydbm.rnn.encoder_decoder_controller module

class pydbm.rnn.encoder_decoder_controller.EncoderDecoderController

Bases: object

Encoder/Decoder based on LSTM networks.

decoder

getter

encoder

getter

get_decoder()

getter

get_encoder()

getter

get_feature_points()

Extract the activities in hidden layer and reset it, considering this method will be called per one cycle in instances of time-series.

Returns:The array like or sparse matrix of feature points.
get_reconstruction_error()

Extract the reconstructed error in inferencing.

Returns:The array like or sparse matrix of reconstruction error.
get_verificatable_result()

getter

inference()

Inference the feature points to reconstruct the time-series.

Override.

Parameters:
  • observed_arr – Array like or sparse matrix as the observed data ponts.
  • hidden_activity_arr – Array like or sparse matrix as the state in hidden layer.
  • rnn_activity_arr – Array like or sparse matrix as the state in RNN.
Returns:

Tuple(

Array like or sparse matrix of reconstructed instances of time-series, Array like or sparse matrix of the state in hidden layer, Array like or sparse matrix of the state in RNN

)

learn()

Learn the observed data points for vector representation of the input time-series.

Override.

Parameters:
  • observed_arr – Array like or sparse matrix as the observed data ponts.
  • target_arr – Array like or sparse matrix as the target data points. To learn as Auto-encoder, this value must be None or equivalent to observed_arr.
set_readonly()

setter

set_verificatable_result()

setter

verificatable_result

getter

pydbm.rnn.lstm_model module

class pydbm.rnn.lstm_model.LSTMModel

Bases: pydbm.rnn.interface.reconstructable_model.ReconstructableModel

Long short term memory(LSTM) networks.

forward_propagation()

Forward propagation.

Parameters:batch_observed_arr – Array like or sparse matrix as the observed data points.
Returns:Array like or sparse matrix as the predicted data points.
get_feature_points()

Extract the activities in hidden layer and reset it, considering this method will be called per one cycle in instances of time-series.

Returns:The list of array like or sparse matrix of feature points or virtual visible observed data points.
get_graph()

getter

get_verificatable_result()

getter

graph

getter

hidden_back_propagate()

Back propagation in hidden layer.

Parameters:delta_output_arr – Delta.
Returns:
Tuple(
np.ndarray of Delta, list of gradations

)

hidden_forward_propagate()

Forward propagation in LSTM gate.

Parameters:observed_arrnp.ndarray of observed data points.
Returns:Predicted data points.
inference()

Inference the feature points to reconstruct the time-series.

Override.

Parameters:
  • observed_arr – Array like or sparse matrix as the observed data points.
  • hidden_activity_arr – Array like or sparse matrix as the state in hidden layer.
  • rnn_activity_arr – Array like or sparse matrix as the state in RNN.
Returns:

Tuple(

Array like or sparse matrix of reconstructed instances of time-series, Array like or sparse matrix of the state in hidden layer, Array like or sparse matrix of the state in RNN

)

learn()

Learn the observed data points for vector representation of the input time-series.

Override.

Parameters:
  • observed_arr – Array like or sparse matrix as the observed data points.
  • target_arr – Array like or sparse matrix as the target data points. To learn as Auto-encoder, this value must be None or equivalent to observed_arr.
lstm_backward()

Back propagation in LSTM gate.

Parameters:
  • delta_hidden_arr – Delta from output layer to hidden layer.
  • delta_rnn_arr – Delta in LSTM gate.
  • cycle – Now cycle or time.
Returns:

Tuple(

Delta from hidden layer to input layer, Delta in hidden layer at previous time, Delta in LSTM gate at previous time, list of gradations.

)

optimize()

Back propagation.

Parameters:
  • grads_listlist of graduations.
  • learning_rate – Learning rate.
  • epoch – Now epoch.
output_back_propagate()

Back propagation in output layer.

Parameters:
  • pred_arrnp.ndarray of predicted data points.
  • delta_output_arr – Delta.
Returns:

Tuple(

np.ndarray of Delta, list of gradations

)

output_forward_propagate()

Forward propagation in output layer.

Parameters:pred_arrnp.ndarray of predicted data points.
Returns:np.ndarray of propagated data points.
set_graph()

setter

set_verificatable_result()

setter

verificatable_result

getter

Module contents