autopycoin.models.create_generic_nbeats#

autopycoin.models.create_generic_nbeats(label_width: int, g_forecast_neurons: int = 524, g_backcast_neurons: int = 524, n_neurons: int = 524, n_blocks: int = 1, n_stacks: int = 30, drop_rate: float = 0.0, share: bool = False, name: str = 'generic_NBEATS', **kwargs: dict)[source]#

Wrapper which create a generic model as described in the original paper.

In the same stack, it is possible to share the weights between blocks.

Parameters
label_widthint

Past to rebuild. Usually, label_width = n * input width with n between 1 and 7.

n_neuronsint

Number of neurons in th Fully connected generic layers.

n_blocksint

Number of blocks per stack.

n_stacksint

Number of stacks in the model.

drop_ratefloat

Rate of the dropout layer. This is used to estimate the epistemic error. Expected a value between 0 and 1. Default to 0.

sharebool

If True, the weights are shared between blocks inside a stack. Default to True.

Returns
modelautopycoin.models.NBEATS

Return an generic model with n stacks defined by the parameter n_stack and respoectively n blocks defined by n_blocks.

Examples

>>> from autopycoin.models import create_generic_nbeats
>>> from autopycoin.losses import QuantileLossError
>>> model = create_generic_nbeats(label_width=3,
...                               g_forecast_neurons=16,
...                               g_backcast_neurons=16,
...                               n_neurons=16,
...                               n_blocks=3,
...                               n_stacks=3,
...                               drop_rate=0.1,
...                               share=True)
>>> model.compile(loss=QuantileLossError(quantiles=[0.5]))