Closed PeterPann23 closed 5 years ago
Unrelated to your question, but worth to mention. You can combine your features together with concat and appy normalization to them, rather than apply normalization for each of them and then concat. In first case we need to pass through data once, in second case we need to pass through data for each column. So nine times in your case.
You do use advanced options, but some of them is actually unrelated to trainer and become hidden in 0.10. Like Caching or NormalizeFeatures. DecreaseLearningRate is turn on for this trainer by default, so it change doesn't make any difference.
I've run locally on some internal datasets and as soon as I'm using MeanVar normalization, I get awful models, mostly because this algorithm expects features to be in [0;1) range, while MeanVar can produce values out of that range.
So my guess would be, we just run into overflow situation because of not expected normalization and one of the weight or bias for model become Infinite value. Can you try to use min-max normalization instead.
Hi Ivan
Yes, I tried the MinMax, option did not solve my issue and none of my values in the training data contain anything but valid floats.
Sorry for late response, any way you can share your data and pipeline? I would suggest to try different learning rates and other parameters. Learner just refuse to converge on your dataspace, it's hard to say why it's happening without looking on the data.
Sure,
I have removed the utility code that manages the BL in my app to something that "makes sense",The pipeline is attached. There is a limitation on size so data will be an issue as it is 13.803.613 KB I can't generate a binary version of the training file as it bluescreens my station when I do that.
I will update and provide a link to the training file when it uploaded to the cloud
Hi Ivan
Actually I have 665 columns, how would I go and Combine them and then normalise them?
Peter
Von: Ivan Matantsev notifications@github.com Gesendet: Tuesday, February 5, 2019 11:28:21 PM An: dotnet/machinelearning Cc: PeterPann23; Author Betreff: Re: [dotnet/machinelearning] OnlineGradientDescent throws exception (#2407)
Unrelated to your question, but worth to mention. You can combine your features together with concat and appy normalization to them, rather than apply normalization for each of them and then concat. In first case we need to pass through data once, in second case we need to pass through data for each column. So nine times in your case.
You do use advanced options, but some of them is actually unrelated to trainer and become hidden in 0.10. Like Caching or NormalizeFeatures. DecreaseLearningRate is turn on for this trainer by default, so it change doesn't make any difference.
I've run locally on some internal datasets and as soon as I'm using MeanVar normalization, I get awful models, mostly because this algorithm expects features to be in [0;1) range, while MeanVar can produce values out of that range.
So my guess would be, we just run into overflow situation because of not expected normalization and one of the weight or bias for model become Infinite value. Can you try to use min-max normalization instead.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fmachinelearning%2Fissues%2F2407%23issuecomment-460829344&data=02%7C01%7C%7Cb24ea98eb60445ac9a9608d68bb93cba%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636850025028320055&sdata=jfAKGyq67LBIYbFUuGdVy4yfNqBxyKE%2BmfL425Vz0L0%3D&reserved=0, or mute the threadhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAqWAtuZ3FCrvBZN109p_sCvNTmw820r5ks5vKgWFgaJpZM4aiBVa&data=02%7C01%7C%7Cb24ea98eb60445ac9a9608d68bb93cba%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636850025028330060&sdata=0D%2FzLyyKqGg2M4gOoD4lKEASBHjycy7qx13gumINQOg%3D&reserved=0.
var data = mlContext.Data.ReadFromEnumerable(enumerableOfData);
var allNonLabelColumns = data.Schema.Where(x => x.Name != "Label" && !x.IsHidden).Select(x => x.Name);
var pipeline = mlContext.Transforms.Concatenate("Features", allNonLabelColumns.ToArray()).Append(
mlContext.Transforms.Normalize("Features"));
Feel free to play with Schema object, you can do various filtration over it, filter by type, name, index position.
Notice what I combine all non labels columns into one column and only after that I applied normalization to it. This is proper template to process data. If you do it in opposite way, we need to fetch one column from your source, process it, and then go to another column and so one, if you have 665 columns we will iterate over your dataset 665 times. If we combine them first into one column, we will do only one pass over data.
Thanks, Will test the output an see if I get similar results.
System information
Issue
What did I do
I configured the estimator chain like so:
Previously I had 119 data points in the model and had no error.
I test the models based on the parameter telling it what network to learn, the item causing the error is this
after, I think, the .net framework throws an error in my running test (no debugger attached)
Source code / logs
:
_[Source=NormalizingEstimator; RowToRowMapperTransform; Cursor, Kind=Trace] Channel finished. Elapsed 00:04:53.5139276. [Source=NormalizingEstimator; RowToRowMapperTransform; Cursor, Kind=Trace] Channel disposed [Source=ColumnConcatenatingEstimator ; RowToRowMapperTransform; Cursor, Kind=Trace] Channel finished. Elapsed 00:04:53.4765765. [Source=ColumnConcatenatingEstimator ; RowToRowMapperTransform; Cursor, Kind=Trace] Channel disposed [Source=ColumnConcatenatingEstimator ; RowToRowMapperTransform; Cursor, Kind=Trace] Channel finished. Elapsed 00:04:53.4197884. [Source=ColumnConcatenatingEstimator ; RowToRowMapperTransform; Cursor, Kind=Trace] Channel disposed [Source=Stochastic Gradient Descent (Regression); Training, Kind=Trace] 2/4/2019 2:59:47 PM Finished training iteration 1; iterated over 3412517 examples. [Source=Stochastic Gradient Descent (Regression); Training, Kind=Trace] Channel finished. Elapsed 00:04:56.6368673. [Source=Stochastic Gradient Descent (Regression); Training, Kind=Trace] Channel disposed
Exception OnlineGradientDescent:The weights/bias contain invalid values (NaN or Infinite). Potential causes: high learning rates, no normalization, high initial weights, etc. Exception:The weights/bias contain invalid values (NaN or Infinite). Potential causes: high learning rates, no normalization, high initial weights, etc. testhost.exe Error: 0 : The weights/bias contain invalid values (NaN or Infinite). Potential causes: high learning rates, no normalization, high initial weights, etc._
full log is attached Learning exception.zip