Setting median outputs as default. Also minor changes to finetuning notebook.
This commit is contained in:
+10
-11
@@ -62,15 +62,14 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"tfm = timesfm.TimesFm(\n",
|
||||
" context_len=512,\n",
|
||||
" horizon_len=128,\n",
|
||||
" input_patch_len=32,\n",
|
||||
" output_patch_len=128,\n",
|
||||
" num_layers=20,\n",
|
||||
" model_dims=1280,\n",
|
||||
" backend=\"gpu\",\n",
|
||||
")\n",
|
||||
"tfm.load_from_checkpoint(repo_id=\"google/timesfm-1.0-200m\")"
|
||||
" hparams=timesfm.TimesFmHparams(\n",
|
||||
" backend=\"gpu\",\n",
|
||||
" per_core_batch_size=32,\n",
|
||||
" horizon_len=128,\n",
|
||||
" ),\n",
|
||||
" checkpoint=timesfm.TimesFmCheckpoint(\n",
|
||||
" huggingface_repo_id=\"google/timesfm-1.0-200m\"),\n",
|
||||
" )"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -209,8 +208,8 @@
|
||||
"for batch in tqdm(test_batches.as_numpy_iterator()):\n",
|
||||
" past = batch[0]\n",
|
||||
" actuals = batch[3]\n",
|
||||
" _, forecasts = tfm.forecast(list(past), [0] * past.shape[0])\n",
|
||||
" forecasts = forecasts[:, 0 : actuals.shape[1], 5]\n",
|
||||
" forecasts, _ = tfm.forecast(list(past), [0] * past.shape[0], normalize=True)\n",
|
||||
" forecasts = forecasts[:, 0 : actuals.shape[1]]\n",
|
||||
" mae_losses.append(np.abs(forecasts - actuals).mean())\n",
|
||||
"\n",
|
||||
"print(f\"MAE: {np.mean(mae_losses)}\")"
|
||||
|
||||
Reference in New Issue
Block a user