Custom Layers¶
Custom layers that can be used to build extended PyTorch models for forecasting.
- References:
- Concrete Dropout is used for approximate posterior Bayesian inference.
-
class
custom_layers.
ConcreteDropout
(dropout_regularizer=1e-05, init_range=(0.1, 0.3), channel_wise=False)¶ Applies Dropout to the input, even at prediction time and learns dropout probability from the data.
In convolutional neural networks, we can use dropout to drop entire channels using the ‘channel_wise’ argument.
- Arguments:
- dropout_regularizer (float): Should be set to 2 / N, where N is the number of training examples.
- init_range (tuple): Initial range for dropout probabilities.
- channel_wise (boolean): apply dropout over all input or across convolutional channels.
-
forward
(x)¶ Returns input but with randomly dropped out values.