SciSharp / TensorFlow.NET

.NET Standard bindings for Google's TensorFlow for developing, training and deploying Machine Learning models in C# and F#.
https://scisharp.github.io/tensorflow-net-docs
Apache License 2.0
3.17k stars 506 forks source link

[Feature Request]: Support multi-output models #1199

Open Utanapishtim31 opened 8 months ago

Utanapishtim31 commented 8 months ago

Background and Feature Description

It is not possible to train a model with several outputs. This is a problem for Actor-Critic models for instance. This is a serious limitation of Tensorflow.NET for the time being.

API Definition and Usage

IModel.compile(IOptimizer, ILossFunc[], IMetricFunc[])

Alternatives

No response

Risks

This does not seem to be very complex to add this feature. Most of the code already exists to handle multi-output. One should compute the loss for each output and sum-reduce the losses to get the final loss.