Open thomasnield opened 6 years ago
Did it work for you? I'm open to any/all suggestions.
@apete so far yes this worked awesome. It worked with beautiful accuracy on my example after enough training and hyperparameter tuning.
I think would be good to rename apply() to predict(). The apply() is a scope function in Kotlin so it might be confusing.
I'm going to mess around with this on a few more simple examples, like modeling nonlinear equations.
That apply(...) comes from java.util.function.UnaryOperator. Is using the various classes in that package problematic with Kotlin?
The NetworkBuilder just wraps the ANN. If you keep it you can continue to modify the underlying ANN. No guarantee it will stay this way, but it is how it works for now.
Also the results array is reused. You need to read/copy those values before you "predict" again.
@apete It's not showstopper, just might cause some confusion for Kotlin devs. In Kotlin every type has an apply()
function to manipulate that item within a closure. Kotlin devs will think of this apply()
which has been overridden by ojAlgo.
val myMutableItem = ...
myMutableItem.apply {
mutableProperty1 = 3
mutableProperty2 = 5
}
Thankfully the Kotlin compiler will let a hard apply()
function take precedence over the standard library's apply()
. But I'd recommend using test()
, predict()
, or some other function name since it clashes with Kotlin scope functions. I know DL4J uses output()
but I don't like that name :/
If not, no worries. It can be worked with.
And makes sense regarding the builder structure. I like it.
DSL needs to be implemented for artifical neural nework.