pytorch-forecasting icon indicating copy to clipboard operation
pytorch-forecasting copied to clipboard

TFT plotting a single "observed" curve in a Multi Target problem

Open FrancescoFondaco opened this issue 3 years ago • 0 comments

PyTorch-Forecasting version: 0.10.2 PyTorch version: Python version: 3.8.5 Operating System: Windows

Hi all, I'm trying to implement a Multi-Target regression problem using pytorch-forecasting TFT. As in the image below, despite the code is running smoothly, the plot_prediction() method is showing a single observed curve and two predicted ones.

image

My dataloader configuration:

training = TimeSeriesDataSet( myData, time_idx="Time_idx", target=["Target1","Target2"], group_ids=["Fund"], min_encoder_length=20, max_encoder_length=80, min_prediction_length=1, max_prediction_length=7, static_categoricals=["Fund"], static_reals=["Vintage", ....], time_varying_unknown_categoricals=[], time_varying_unknown_reals=['NAV', .... ], target_normalizer=MultiNormalizer( normalizers=[GroupNormalizer(),GroupNormalizer()] ), add_relative_time_idx=False, add_target_scales=False, add_encoder_length=True, #randomize_length=(10,1) )

And then:

tft = TemporalFusionTransformer.from_dataset( training, learning_rate=0.001, hidden_size=16, attention_head_size=2, hidden_continuous_size=8, output_size=[7,7], loss=MultiLoss([QuantileLoss(), QuantileLoss()]), log_interval=10, )

Has anyone encountered this problem? Thanks, Francesco

FrancescoFondaco avatar Jul 08 '22 13:07 FrancescoFondaco