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.23k stars 517 forks source link

[Question]: CallbackParameters when using function model.Fit() #1130

Closed kojack14 closed 1 year ago

kojack14 commented 1 year ago

Description

I want to use the EarlyStopping object to identify when the model achieved convergence in training, but I can't use it in the Fit() function. Follow the code example below:

var CallbackParameters = new CallbackParams { };

        var earlyStopping = new EarlyStopping(parameters: CallbackParameters, monitor: "val_loss", mode: "min", patience: 5);

Alternatives

No response

Wanglongzhi2001 commented 1 year ago

Hello, please refer to https://github.com/SciSharp/TensorFlow.NET/blob/dfd9dd0d207cb6984494f3d22f301cfacb326490/test/TensorFlowNET.Keras.UnitTest/Callbacks/EarlystoppingTest.cs#L54-L63

kojack14 commented 1 year ago

thanks, problem solved