SciSharp / SiaNet

An easy to use C# deep learning library with CUDA/OpenCL support
https://scisharp.github.io/SiaNet
MIT License
380 stars 83 forks source link

Issues training with large batch - #12

Closed deepakkumar1984 closed 6 years ago

deepakkumar1984 commented 6 years ago

From @Sam7: I was using just started moving an existing implementation that was using AleaTK to use your SiaNet. It seems to be running but the prediction result is always around 0. I used to have batch size of 10000 for the AleaTK implementation which worked well, since the model is very small and I have stacks of training data. But with SiaNet it's always 0 except when I go to a VERY small batch size of 32. Any idea why that could be? (I'm using the XYFrame method not the Image one)

Sam7 commented 6 years ago

This happened in a first test project that I like to use for myself when learning new deep learning frameworks. It's basically trying to predict an arbitrary function like this: var dataSet = FunctionTrainingData.CreateTrainingData(x => Math.Min(Math.Sin(x), Math.Cos(x * 1.5)) + Math.Max(Math.Sin(x * 2.1), Math.Cos(x * 2.9)) + rng.NextDouble() * randomizeFactor, inputSize, predictionGap, zoom);

When I have a bit of time on my hand I will try and extract it out into a testable project.

deepakkumar1984 commented 6 years ago

Thanks, Please let me know if you are still facing issue with the test project.

deepakkumar1984 commented 6 years ago

The issue is fixed now. I found a bug with the code with large batch size