Github user bgreeven commented on the pull request:
https://github.com/apache/spark/pull/1290#issuecomment-67281152
So you mean something as follows?
---
abstract class OptimizerInfo {}
case class OptimizerInfoSGD extends OptimizerInfo {
var noIterations: Int = 1000;
var batchFrac: Double = 1.0;
}
case class OptimizerInfoLBFGS extends OptimizerInfo {
var maxIterations: Int = 1000;
var tolerance: Double = 1e-4;
}
---
And in the training function:
---
def train(..., oi: OptimizerInfo): ArtificalNeuralNetworkModel = {
oi match {
case OptimizerInfoLBFGS() =>
// perform LBFGS optimisation
case OptimizerInfoSGD() =>
// perform SGD optimisation
}
}
---
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]