pydbm.loss package

Submodules

pydbm.loss.cross_entropy module

class pydbm.loss.cross_entropy.CrossEntropy

Bases: pydbm.rnn.loss.interface.computable_loss.ComputableLoss

Cross Entropy.

compute_delta()

Backward delta.

Parameters:
  • pred_arr – Predicted data.
  • labeled_arr – Labeled data.
  • delta_output – Delta.
Returns:

Delta.

compute_loss()

Return of result from this Cost function.

Parameters:
  • pred_arr – Predicted data.
  • labeled_arr – Labeled data.
  • axis – Axis or axes along which the losses are computed. The default is to compute the losses of the flattened array.
Returns:

Cost.

pydbm.loss.mean_squared_error module

class pydbm.loss.mean_squared_error.MeanSquaredError

Bases: pydbm.rnn.loss.interface.computable_loss.ComputableLoss

The mean squared error (MSE).

References

  • Pascanu, R., Mikolov, T., & Bengio, Y. (2012). Understanding the exploding gradient problem. CoRR, abs/1211.5063, 2.
  • Pascanu, R., Mikolov, T., & Bengio, Y. (2013, February). On the difficulty of training recurrent neural networks. In International conference on machine learning (pp. 1310-1318).
compute_delta

Backward delta.

Parameters:
  • pred_arr – Predicted data.
  • labeled_arr – Labeled data.
  • delta_output – Delta.
Returns:

Delta.

compute_loss

Return of result from this Cost function.

Parameters:
  • pred_arr – Predicted data.
  • labeled_arr – Labeled data.
  • axis – Axis or axes along which the losses are computed. The default is to compute the losses of the flattened array.
Returns:

Cost.

Module contents