I played around with DL4J a bit but found the synt...
# datascience
t
I played around with DL4J a bit but found the syntax for declaring neural networks a bit lacking. Too Java for my taste. As I am currently trying to pick up Kotlin, I coded a small "library" to help with that using the type-safe builder patterns from the tutorials. You can find it on GitHub or read about it on my blog if you are interested.
K 4
metal 1
m
I think DL4J has some things in Kotlin already. It’d be good to check with them.
t
I had a look at the examples and some had variants in Kotlin. But they looked like stuff generated by the Java2Kotlin tool from ItelliJ. Do you have a link, by chance?
m
@Tilman Krokotsch did you try it in kotlin-jupyter ?
t
No, I didn't. I don't like notebooks that much for my day to day work. Why are you asking?
m
I am just curious, I guest, since its a jvm library, it can be added to a kotlin kernel the same way as any other, I will check that later…
a
There are modules for dl4j in kotlin jupyter already
👍 1
m
I can confirm this is indeed working even with klay from jitpack
Copy code
%use deeplearning4j
@file:DependsOn("com.github.tilman151:klay:-SNAPSHOT")

import org.klay.nn.* 

val conf = sequential {
                    layers {
                        dense {
                            nIn(10)
                            nOut(100)
                            activation(Activation.RELU)
                        }
                    }
                }
print(conf)
t
@Michal Harakal now I am getting what you meant. Yeah, as klay is only plain old Kotlin it should all work out of the box^^
a
You can use plain java libraries in kotlin-jupyter. The only thing you can not are non-jvm librararies like native
t
Sure, but my project was not getting dl4j to work in kotlin, but making it look better^^
m
@Tilman Krokotsch yeah DSL helps a lot, I liked your article explaining the step from builders to dsl.. Even in jupyter it works quite well with context sensitive help etc.
☺️ 1
t
@Michal Harakal thanks a lot
m
Last time I was hearing data science podcast from 2015 where ipython and python was hot thing, I hope have the same discussion about kotlin, hopefully sooner 🙂
a
@Michal Harakal I give a talk about that in a meetup tomorrow 🙂
m
do you have a link?
t
I would like that. Just today I had to work with multiprocessing in Python again...the pain
a
@Tilman Krokotsch I do not actually do ML, but I think thigs like the one you did are quite important for the ecosystem
@Michal Harakal. It is in Russian. But it mostly follows my KotlinConf-19 talk.
👍 1
m
I could refresh my grammar school russian 🙂
t
@altavir Thanks, maybe someone will use my stuff one day^^ I would like to see your talk, too, but I do not speak russian. Do you have a link to your KotlinConf talk?
a
Here you are:

https://youtu.be/LI_5TZ7tnOE

. The problem with visualization seems to be mostly fixed since that time.
t
Thx