public static class ConvolutionalNetwork.Builder extends Object
ConvolutionalNetwork
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ConvolutionalNetwork.Builder |
addConvolutionalLayer(int channelNum)
Adds a convolutional layer with the given number of channels(filters),
with default 3x3 filter size and default activation function.
|
ConvolutionalNetwork.Builder |
addConvolutionalLayer(int channelNum,
ActivationType activationType)
Adds a convolutional layer with the given number of channels(filters),
with given activation function type and default 3x3 filter size.
|
ConvolutionalNetwork.Builder |
addConvolutionalLayer(int channelNum,
Filter filter)
Adds a convolutional layer with the given number of channels(filters),
with given settings of a convolutional filter and default type of activation function.
|
ConvolutionalNetwork.Builder |
addConvolutionalLayer(int channelNum,
Filter filter,
ActivationType activationType)
Adds a convolutional layer with the given number of channels(filters),
with given settings of a convolutional filter and given type of activation function.
|
ConvolutionalNetwork.Builder |
addConvolutionalLayer(int channelNum,
int filterSize)
Adds a convolutional layer with the given number of channels(filters),
with given filter size (same width and height) and default activation function.
|
ConvolutionalNetwork.Builder |
addConvolutionalLayer(int channelNum,
int filterSize,
ActivationType activationType)
Adds a convolutional layer with the given number of channels(filters),
with given filter size (same width and height) and given type of activation function.
|
ConvolutionalNetwork.Builder |
addConvolutionalLayer(int channelNum,
int filterWidth,
int filterHeight)
Adds a convolutional layer with the given number of channels(filters),
with given width and height of convolutional filter and default type of activation function.
|
ConvolutionalNetwork.Builder |
addConvolutionalLayer(int filterWidth,
int filterHeight,
int channelNum,
int stride)
Adds a convolutional layer with the given width and height of convolutional filters,
given number of channels(filters) and stride(filter step), and default type of activation function.
|
ConvolutionalNetwork.Builder |
addConvolutionalLayer(int filterWidth,
int filterHeight,
int channelNum,
int stride,
ActivationType activationType)
Adds a convolutional layer with the given width and height of convolutional filters,
given number of channels(filters) and stride(filter step), and given type of activation function.
|
ConvolutionalNetwork.Builder |
addFullyConnectedLayer(int layerWidth)
Adds fully connected layer with specified width and default activation function.
|
ConvolutionalNetwork.Builder |
addFullyConnectedLayer(int layerWidth,
ActivationType activationType)
Adds fully connected layer with specified width and activation function.
|
ConvolutionalNetwork.Builder |
addInputLayer(int width,
int height)
Input layer with specified width and height, and 3 channels by
default.
|
ConvolutionalNetwork.Builder |
addInputLayer(int width,
int height,
int channels)
Input layer with specified width, height and number of channels (depth).
|
ConvolutionalNetwork.Builder |
addLayer(AbstractLayer layer)
Adds a given layer to the network.
|
ConvolutionalNetwork.Builder |
addMaxPoolingLayer(Filter filter)
Adds a max pooling layer with the given filter settings.Max pooling layer comes after convolutional layer and reduces the dimensions of the input received from the previous layer.
|
ConvolutionalNetwork.Builder |
addMaxPoolingLayer(int filterSize) |
ConvolutionalNetwork.Builder |
addMaxPoolingLayer(int filterSize,
int stride)
Adds a max pooling layer with given filter size and stride(filter step).
|
ConvolutionalNetwork.Builder |
addMaxPoolingLayer(int filterWidth,
int filterHeight,
int stride)
Adds a max pooling layer with given filter size and stride(filter step).Max pooling layer comes after convolutional layer and reduces the dimensions of the input received from the previous layer.Typically filter sizes of 2 are used, which effectively halves the dimensions of the input from the previous layer.
|
ConvolutionalNetwork.Builder |
addOutputLayer(int layerWidth,
ActivationType activationType)
Adds output layer to the neural network with specified width (number of outputs) and activation function type.
|
ConvolutionalNetwork.Builder |
addOutputLayer(int layerWidth,
Class<? extends OutputLayer> clazz)
Adds output layer to the neural network with specified width (number of outputs) and layer class.
|
ConvolutionalNetwork |
build()
Builds an instance of ConvolutionalNetwork with settings specified in this builder.
|
ConvolutionalNetwork.Builder |
hiddenActivationFunction(ActivationType activationType)
Sets default type of the activation function to use for all hidden layers in the network.
|
ConvolutionalNetwork.Builder |
lossFunction(Class<? extends LossFunction> clazz) |
ConvolutionalNetwork.Builder |
lossFunction(LossType lossType)
Sets loss function to be used by created neural network.
|
ConvolutionalNetwork.Builder |
randomSeed(long seed)
Initializes random number generator with the specified seed in order to
get same random number sequences used for weights initialization.
|
public ConvolutionalNetwork.Builder addInputLayer(int width, int height)
width
- height
- public ConvolutionalNetwork.Builder addInputLayer(int width, int height, int channels)
width
- width of the input Tensorheight
- height of the input Tensorchannels
- depth of the input Tensorpublic ConvolutionalNetwork.Builder addFullyConnectedLayer(int layerWidth)
layerWidth
- width of the layer which corresponds to the number of outputs/neurons in this layerFullyConnectedLayer
,
ActivationType
public ConvolutionalNetwork.Builder addFullyConnectedLayer(int layerWidth, ActivationType activationType)
layerWidth
- width of the layer which corresponds to the number of outputs/neurons in this layeractivationType
- type of activation functionFullyConnectedLayer
,
ActivationType
public ConvolutionalNetwork.Builder addOutputLayer(int layerWidth, Class<? extends OutputLayer> clazz)
layerWidth
- width of the layer which corresponds to number of network's outputsclazz
- class of the output layerpublic ConvolutionalNetwork.Builder addOutputLayer(int layerWidth, ActivationType activationType)
layerWidth
- width of the layer which corresponds to number of network's outputsactivationType
- type of the activation function to use in output layerpublic ConvolutionalNetwork.Builder addConvolutionalLayer(int channelNum)
channelNum
- number of channels(filters) in the convolutional layerConvolutionalLayer
public ConvolutionalNetwork.Builder addConvolutionalLayer(int channelNum, ActivationType activationType)
channelNum
- number of channels(filters) in the convolutional layeractivationType
- type of the activation function in the convolutional layerConvolutionalLayer
,
ActivationType
public ConvolutionalNetwork.Builder addConvolutionalLayer(int channelNum, int filterSize)
channelNum
- number of channels(filters) in the convolutional layerfilterSize
- size of the convolutional filter (same width and height)ConvolutionalLayer
public ConvolutionalNetwork.Builder addConvolutionalLayer(int channelNum, int filterSize, ActivationType activationType)
channelNum
- number of channels(filters) in the convolutional layerfilterSize
- size of the convolutional filter (same width and height)activationType
- type of the activation function in the convolutional layerConvolutionalLayer
,
ActivationType
public ConvolutionalNetwork.Builder addConvolutionalLayer(int channelNum, int filterWidth, int filterHeight)
channelNum
- number of channels(filters) in the convolutional layerfilterWidth
- width of a convolutional filterfilterHeight
- height of a convolutional filterConvolutionalLayer
public ConvolutionalNetwork.Builder addConvolutionalLayer(int channelNum, Filter filter)
channelNum
- number of channels(filters) in the convolutional layerfilter
- settings of the convolutional filter(width, height, stride, padding)ConvolutionalLayer
public ConvolutionalNetwork.Builder addConvolutionalLayer(int filterWidth, int filterHeight, int channelNum, int stride)
filterWidth
- width of a convolutional filterfilterHeight
- height of a convolutional filterchannelNum
- number of channels(filters)stride
- filter stride(step)ConvolutionalLayer
public ConvolutionalNetwork.Builder addConvolutionalLayer(int channelNum, Filter filter, ActivationType activationType)
channelNum
- number of channels(filters) in the convolutional layerfilter
- settings of the convolutional filter(width, height, stride, padding)activationType
- type of the activation function in the convolutional layerConvolutionalLayer
,
ActivationType
public ConvolutionalNetwork.Builder addConvolutionalLayer(int filterWidth, int filterHeight, int channelNum, int stride, ActivationType activationType)
filterWidth
- width of a convolutional filterfilterHeight
- height of a convolutional filterchannelNum
- number of channels(filters)stride
- filter stride(step)activationType
- type of the activation function in the convolutional layerConvolutionalLayer
,
ActivationType
public ConvolutionalNetwork.Builder addMaxPoolingLayer(int filterSize, int stride)
filterSize
- size of the max pooling filter(typically 2)stride
- filter step size which is typically same as filter size for pooling layers.public ConvolutionalNetwork.Builder addMaxPoolingLayer(int filterSize)
public ConvolutionalNetwork.Builder addMaxPoolingLayer(int filterWidth, int filterHeight, int stride)
filterWidth
- pooling filter widthfilterHeight
- pooling filter heightstride
- filter step size which is typically same as filter size for pooling layers.public ConvolutionalNetwork.Builder addMaxPoolingLayer(Filter filter)
filter
- settings of the pooling filter(width, height, stride, padding)public ConvolutionalNetwork.Builder addLayer(AbstractLayer layer)
layer
- public ConvolutionalNetwork.Builder hiddenActivationFunction(ActivationType activationType)
activationType
- type of activation functionActivationType
public ConvolutionalNetwork.Builder lossFunction(Class<? extends LossFunction> clazz)
public ConvolutionalNetwork.Builder lossFunction(LossType lossType)
lossType
- type of a loss functionpublic ConvolutionalNetwork.Builder randomSeed(long seed)
seed
- public ConvolutionalNetwork build()
Copyright © 2022. All rights reserved.