zhongkaifu / Seq2SeqSharp

Seq2SeqSharp is a tensor based fast & flexible deep neural network framework written by .NET (C#). It has many highlighted features, such as automatic differentiation, different network types (Transformer, LSTM, BiLSTM and so on), multi-GPUs supported, cross-platforms (Windows, Linux, x86, x64, ARM), multimodal model for text and images and so on.
Other
193 stars 38 forks source link

Adding parameter checking - First step #79

Closed zsogitbe closed 7 months ago

zsogitbe commented 7 months ago

We need to check carefully which values each input parameter may have. We also need to check what are the most optimal values for what application. Etc.

TODO: check and validate all values. Correct if needed.

zsogitbe commented 7 months ago

This will be more work. This is just the start of it.

zhongkaifu commented 7 months ago

Hi @zsogitbe It looks pretty useful to automatically verify if the parameter is valid. How does it work if the parameter is invalid? When will the .NET runtime check the parameters? (Will the parameter be checked when it's called everytime?) I checked some documents, but they are all bout ASP.NET MVC web application, can this attribute be used for other types of application, such as console, web service ?

zsogitbe commented 7 months ago

Hi Zhongkai,

Yes, it is very important because we have a lot of parameters and the quality of the models depend on them!

So, what we have started is the first step. We need to make sure that we know and set all ranges and possible values (enums) of all variables.

The second step is the automatic checking of these variables. This can be done, for example, by saving a json schema automatically of the input variables based on the annotations we have introduced (check add-ins for VS which can save a json schema from a class definition -> in the created schema all limits we set will be introduced...). The schema can then be used to check all parameters if they are valid. Or even more interesting, we can also suggest to the user automatically to change some of the variables for obtaining better results… But, the annotations we introduce can probably also be used in another way not using json for checking the parameter values at runtime.

For the moment these annotations will do nothing. We will have to add some code to use them.

Best regards, Zoli