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.2k stars 514 forks source link

feat: add Activation Adaptor #1085

Closed lingbai-kong closed 1 year ago

lingbai-kong commented 1 year ago

I have created a new class called ActivationAdaptor, which enables Layers to accept different types of activation parameters, such as the string "tanh", Activation, and Func. This also provides convenience for adding more types of activations in the future, which avoids redunctunt overloaded function and ensures clarity of the source code. I'm not sure if this PR is suitable, I would appreciate it if you could carefully review the differences and provide any necessary feedback. By the way, if this PR is approved, I plan to add similar adaptors for Initializer and IRegularizer. Thanks!

lingbai-kong commented 1 year ago

There is a failure in linux build and test. The log does not shows any useful information but a error code MSB4166. The stackoverflow said the cause is not sure but add the /nodeReuse:false to the msbuild command can help fix this issue. However, the build and test passed on Windows. So... does it matter?