The current implementation has some issues - which makes it hard to implement new outputs / modify existing ones.
Subclasses of Output modify and use PredictMetadata in different ways - which tends to cause issues when using multiple outputs or multiple instances of the same output or outputs that require intermediate.
- This can be solved by creating a single immutable instance of PredictMetadata which describes what is passed from the model to all the outputs via add_forecast(... pred) (each Output recieves the same pred), and then each output has to use the same PredictMetadata to figure out how to route the data correctly.
- Currently this is solved with a number of if-statements / checks to make the code functional.
Intermediate probably should not subclass from Output - atleast we should not have to call intermediate.add_forecast the way we currently do. add_forecast expects a full forecast outputs, and does several checks for this - but the intermediate shape is not necessarily that of the forecast (verif). Currently this issue is circumvented by modifying PredictMetadata.
The current implementation has some issues - which makes it hard to implement new outputs / modify existing ones.
Subclasses of Output modify and use PredictMetadata in different ways - which tends to cause issues when using multiple outputs or multiple instances of the same output or outputs that require intermediate.
Intermediate probably should not subclass from Output - atleast we should not have to call intermediate.add_forecast the way we currently do. add_forecast expects a full forecast outputs, and does several checks for this - but the intermediate shape is not necessarily that of the forecast (verif). Currently this issue is circumvented by modifying PredictMetadata.