From d5f5b9255dc4146e590e0f5394327af0f1eda1a2 Mon Sep 17 00:00:00 2001 From: cchallu Date: Tue, 7 Nov 2023 11:44:09 -0500 Subject: [PATCH 1/2] fix default patchtst --- nbs/models.ipynb | 2 +- neuralforecast/auto.py | 2 +- neuralforecast/models/hint.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nbs/models.ipynb b/nbs/models.ipynb index af6a458bb..42dce4aa6 100644 --- a/nbs/models.ipynb +++ b/nbs/models.ipynb @@ -1683,7 +1683,7 @@ " \"input_size_multiplier\": [1, 2, 3],\n", " \"h\": None,\n", " \"hidden_size\": tune.choice([16, 128, 256]),\n", - " \"n_head\": tune.choice([4, 16]),\n", + " \"n_heads\": tune.choice([4, 16]),\n", " \"patch_len\": tune.choice([16, 24]),\n", " \"learning_rate\": tune.loguniform(1e-4, 1e-1),\n", " \"scaler_type\": tune.choice([None, 'robust', 'standard']),\n", diff --git a/neuralforecast/auto.py b/neuralforecast/auto.py index 5c13ee1a5..848c765da 100644 --- a/neuralforecast/auto.py +++ b/neuralforecast/auto.py @@ -985,7 +985,7 @@ class AutoPatchTST(BaseAuto): "input_size_multiplier": [1, 2, 3], "h": None, "hidden_size": tune.choice([16, 128, 256]), - "n_head": tune.choice([4, 16]), + "n_heads": tune.choice([4, 16]), "patch_len": tune.choice([16, 24]), "learning_rate": tune.loguniform(1e-4, 1e-1), "scaler_type": tune.choice([None, "robust", "standard"]), diff --git a/neuralforecast/models/hint.py b/neuralforecast/models/hint.py index 9e19a0a67..42457018f 100644 --- a/neuralforecast/models/hint.py +++ b/neuralforecast/models/hint.py @@ -24,7 +24,7 @@ def get_bottomup_P(S: np.ndarray): **References:**
- [Orcutt, G.H., Watts, H.W., & Edwards, J.B.(1968). \"Data aggregation and information loss\". The American - Economic Review, 58 , 773{787)](http://www.jstor.org/stable/1815532). + Economic Review, 58 , 773(787)](http://www.jstor.org/stable/1815532). """ n_series = len(S) n_agg = n_series - S.shape[1] From d512fa7bc12d01ad9c1ff5c0da15be7103f10530 Mon Sep 17 00:00:00 2001 From: cchallu Date: Tue, 7 Nov 2023 12:16:33 -0500 Subject: [PATCH 2/2] base recurrent import split --- nbs/common.base_recurrent.ipynb | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/nbs/common.base_recurrent.ipynb b/nbs/common.base_recurrent.ipynb index da17c378b..4a18ec099 100644 --- a/nbs/common.base_recurrent.ipynb +++ b/nbs/common.base_recurrent.ipynb @@ -691,11 +691,19 @@ "outputs": [], "source": [ "#| hide\n", - "# add h=0,1 unit test for _parse_windows \n", "from neuralforecast.losses.pytorch import MAE\n", "from neuralforecast.utils import AirPassengersDF\n", - "from neuralforecast.tsdataset import TimeSeriesDataset, TimeSeriesDataModule\n", - "\n", + "from neuralforecast.tsdataset import TimeSeriesDataset, TimeSeriesDataModule" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#| hide\n", + "# add h=0,1 unit test for _parse_windows \n", "# Declare batch\n", "AirPassengersDF['x'] = np.array(len(AirPassengersDF))\n", "AirPassengersDF['x2'] = np.array(len(AirPassengersDF)) * 2\n", @@ -729,13 +737,6 @@ "test_eq(set(temporal_data_cols), set(['y', 'x', 'x2']))\n", "test_eq(windows['temporal'].shape, torch.Size([1,len(['y', 'x', 'x2', 'available_mask']),117,12+1]))" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": {