-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-35678][ML][FOLLOWUP] softmax support offset and step #32927
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
Conversation
|
Test build #139863 has finished for PR 32927 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
srowen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but are there other places it can be used? let's get as many as we can in one go in one PR / JIRA if possible. They're logically related
| var localLossSum = 0.0 | ||
| var localWeightSum = 0.0 | ||
| var i = 0 | ||
| val probs = Array.ofDim[Double](numClasses) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when softmax support offset & step, this tmp array is no longer needed
| var localWeightSum = 0.0 | ||
| var i = 0 | ||
| val probs = Array.ofDim[Double](numClasses) | ||
| val multiplierSum = Array.ofDim[Double](numClasses) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiplierSum is only needed when fitIntercept is true
| private val marginOffset = if (fitWithMean) { | ||
| val offset = intercept.copy | ||
| @transient private lazy val marginOffset = if (fitWithMean) { | ||
| val offset = new DenseVector(coefficientsArray.takeRight(numClasses)) // intercept |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not call intercept to avoid trigger the lazy initialization of intercept
| val weights = new BDV[Double](0) | ||
|
|
||
| override def eval(data: BDM[Double], output: BDM[Double]): Unit = { | ||
| require(!data.isTranspose && !output.isTranspose) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two BDM are expected to be not transposed here
|
Kubernetes integration test starting |
|
Test build #139879 has finished for PR 32927 at commit
|
|
Kubernetes integration test status success |
|
retest this please |
|
Kubernetes integration test starting |
|
Test build #139905 has finished for PR 32927 at commit
|
|
Kubernetes integration test status success |
|
Thanks @huaxingao @srowen for reviewing! |
|
Merged to master, thanks! |
|
Hm, the tests didn't pass: and seems like it fails. I am reverting this for now. |
|
Sorry, I will be more careful next time. |
|
@HyukjinKwon It is OK to revert this PR, I will send a new one which fix this failed case. |
|
Ah, Jenkins and GA have a a bit different env some times. GA is more correct in general fwiw |
|
OK, we will to be more careful @HyukjinKwon |
What changes were proposed in this pull request?
use newly impled softmax function in NB
Why are the changes needed?
to simplify impl
Does this PR introduce any user-facing change?
No
How was this patch tested?
existing testsuite