Open davaponte opened 3 years ago
Hello!
In the case that you are using NeuralFit, it descents from TMObject
. TMObject
does what you are asking for:
TMObject = class(TObject)
protected
FMessageProc: TGetStrProc;
FErrorProc: TGetStrProc;
public
constructor Create(); virtual;
destructor Destroy(); override;
procedure DefaultMessageProc(const S: string);
procedure DefaultErrorProc(const S: string);
procedure DefaultHideMessages(const S: string);
procedure HideMessages();
published
property MessageProc: TGetStrProc read FMessageProc write FMessageProc;
property ErrorProc: TGetStrProc read FErrorProc write FErrorProc;
end;
You can just attribute new functions to MessageProc
and to ErrorProc
. TNNetNeuron
, TNNetLayer
and TNNet
also descend from TMObject
. Let me know please if there are additional messages that you would like covered by TMObject
.
There is an example here: https://github.com/joaopauloschuler/neural-api#got-too-many-console-messages
@davaponte , please confirm areas that you need writeln replaced first. So far, all fitting writelns (except for csv creation) have been replaced.
It would be nice to provide a callback function to print the output messages in a GUI. For example, a TMemo. I mean the ones that are written with WriteLn.
For example:
will be
and, by default SomeCallBack point to a simple procedure with a WriteLn to don't break anything