rofunc.learning.RofuncRL.models.utils#
1. Module Contents#
1.1. Functions#
Build multi-Layer perceptron :param dims: layer dimensions, including input and output layers :param hidden_activation: activation function for hidden layers :param output_activation: activation function for output layer :return: |
|
Build convolutional neural network :param dims: layer dimensions, including input and output layers :param kernel_size: kernel size for convolutional layers :param stride: stride controls the stride for the cross-correlation :param padding: padding controls the amount of padding applied to the input :param dilation: dilation controls the spacing between the kernel points :param hidden_activation: activation function for hidden layers :param output_activation: activation function for output layer :param pooling: pooling layer type, [‘max’, ‘avg’, ‘none’] :param pooling_args: pooling layer arguments |
|
1.2. API#
- rofunc.learning.RofuncRL.models.utils.build_mlp(dims: [int], hidden_activation: torch.nn = nn.ReLU, output_activation: torch.nn = None) torch.nn.Sequential[source]#
Build multi-Layer perceptron :param dims: layer dimensions, including input and output layers :param hidden_activation: activation function for hidden layers :param output_activation: activation function for output layer :return:
- rofunc.learning.RofuncRL.models.utils.build_cnn(dims: [int], kernel_size: Union[int, tuple, List], stride: Union[int, tuple, List] = 1, padding: Union[int, tuple, List] = 0, dilation: Union[int, tuple, List] = 1, hidden_activation: torch.nn = nn.ReLU, output_activation: torch.nn = None, pooling=None, pooling_args: dict = None) torch.nn.Sequential[source]#
Build convolutional neural network :param dims: layer dimensions, including input and output layers :param kernel_size: kernel size for convolutional layers :param stride: stride controls the stride for the cross-correlation :param padding: padding controls the amount of padding applied to the input :param dilation: dilation controls the spacing between the kernel points :param hidden_activation: activation function for hidden layers :param output_activation: activation function for output layer :param pooling: pooling layer type, [‘max’, ‘avg’, ‘none’] :param pooling_args: pooling layer arguments
The parameters kernel_size, stride, padding, dilation can either be: - a single int: in which case the same value is used for the height and width dimension - a tuple of two ints: in which case, the first int is used for the height dimension, and the second int for the width dimension :return: