ml.nn
NeuralNet and Layer Model definitions with common implementations
- class tinychain.ml.nn.ConvLayer(*args, **kwargs)[source]
-
- classmethod create(inputs_shape, filter_shape, stride=1, padding=1, activation=None, optimal_std=None)[source]
Create a new, empty
ConvLayerwith the given shape and activation function.- Args:
- inputs_shape: size of inputs [c_i, h_i, w_i] where
c_i: number of channels, h_i: channel height, ‘w_i’: channel width;
- filter_shape: size of filter [h_f, w_f, out_c] where
out_c: number of output channels, h_f: kernel height, ‘w_f`: kernel width;
activation: activation function
- eval = <tinychain.reflect.stub.StateFunctionStub object>
- class tinychain.ml.nn.DNN(*args, **kwargs)[source]
Bases:
Sequential- classmethod create(schema)[source]
Create a new
Sequentialneural net ofLinearlayers.schema should be a list of 2- or 3-tuples of the form (input_size, output_size, activation) (the arguments to Linear.create).
- class tinychain.ml.nn.Layer(*args, **kwargs)[source]
Bases:
Model,Differentiable- gradient = <tinychain.reflect.stub.ReflectionStub object>
- class tinychain.ml.nn.Linear(*args, **kwargs)[source]
-
- eval = <tinychain.reflect.stub.StateFunctionStub object>