Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get a model result with all Wi = NaN #17

Closed
makailove123 opened this issue Jan 16, 2017 · 2 comments
Closed

I get a model result with all Wi = NaN #17

makailove123 opened this issue Jan 16, 2017 · 2 comments

Comments

@makailove123
Copy link

I trained a model with 2500000 samples and 900 features. But the result Wi were all NaN. I randomly chose 1000 samples from the dataset, and the reault seems ok.
Does it have limitation on the size of dataset or feature values?

@takun2s
Copy link
Collaborator

takun2s commented Jan 16, 2017

No, there is no limitation of the data size .
You could try to normalize the data .

@qf6101
Copy link

qf6101 commented Jan 16, 2017

I encountered a similar overflow problem with SoftMax. And I fix the code as follows.

val margins = ws.map { w =>
  VectorUtil.wxpb(w,x,1d)
}
val maxMargin = margins.max
val adjustedMargins = margins.map { margin =>
  margin - maxMargin
}
val mes = adjustedMargins.map {...

@takun2s takun2s closed this as completed Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants