pydbm.cnn package

Submodules

pydbm.cnn.convolutional_neural_network module

class pydbm.cnn.convolutional_neural_network.ConvolutionalNeuralNetwork

Bases: object

Convolutional Neural Network.

back_propagation()

Back propagation in CNN.

Parameters:Delta.
Returns.
Delta.
forward_propagation()

Forward propagation in CNN.

Parameters:img_arrnp.ndarray of image file array.
Returns:Propagated np.ndarray.
get_layerable_cnn_list()

getter

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 points.
Returns:Predicted array like or sparse matrix.
layerable_cnn_list

getter

learn()

Learn.

Parameters:
  • observed_arrnp.ndarray of observed data points.
  • target_arrnp.ndarray of labeled data. If None, the function of this cnn model is equivalent to Convolutional Auto-Encoder.
learn_generated()

Learn features generated by FeatureGenerator.

Parameters:feature_generator – is-a FeatureGenerator.
optimize()

Back propagation.

Parameters:
  • learning_rate – Learning rate.
  • epoch – Now epoch.
set_layerable_cnn_list()

setter

set_verificatable_result()

setter

verificatable_result

getter

pydbm.cnn.feature_generator module

class pydbm.cnn.feature_generator.FeatureGenerator

Bases: object

Feature generator.

batch_size

Batch size of Mini-batch.

epochs

Epochs of Mini-batch.

generate()

Generate feature points.

Returns:The tuple of feature points. The shape is: (Training data, Training label, Test data, Test label).

pydbm.cnn.layerable_cnn module

class pydbm.cnn.layerable_cnn.LayerableCNN

Bases: object

The abstract class of convolutional neural network.

affine_to_img()

Affine transform for Convolution.

Parameters:
  • reshaped_img_arrnp.ndarray of 2-rank image array.
  • img_arrnp.ndarray of 4-rank image array.
  • kernel_height – Height of kernel.
  • kernel_width – Width of kernel.
  • stride – Stride.
  • pad – padding value.
Returns:

2-rank image array.

affine_to_matrix()

Affine transform for Convolution.

Parameters:
  • img_arrnp.ndarray of 4-rank image array.
  • kernel_height – Height of kernel.
  • kernel_width – Width of kernel.
  • stride – Stride.
  • pad – padding value.
Returns:

2-rank image array.

back_propagate()

Back propagation in CNN layers.

Parameters:delta_arr – 4-rank array like or sparse matrix.
Returns:3-rank array like or sparse matrix.
delta_bias_arr

Delta of bias vector.

delta_weight_arr

Delta of weight matirx.

forward_propagate()

Forward propagation in CNN layers.

Parameters:matriimg_arr – 4-rank array like or sparse matrix.
Returns:4-rank array like or sparse matrix.
graph

Graph which is-a Synapse.

reset_delta()

Reset delta.

resize_array()

Resize 2-rank np.ndarray.

Parameters:
  • img_arrnp.ndarray.
  • target_shape – Target shape.
Returns:

Resized np.ndarray.

pydbm.cnn.spatio_temporal_auto_encoder module

Module contents