Deep Learning in Kotlin | Deep Neural Networks with KotlinDL
Vložit
- čas přidán 25. 07. 2024
- Deep Learning with Deep Neural Networks in Kotlin with KotlinDL!
In this video, we're going to build, train, and evaluate a deep neural network in Kotlin. We're going to do some image classification on the MNIST handwritten digits dataset. To do so, we're going to use KotlinDL, a deep learning framework developed and maintained by the same company that also develops Kotlin (JetBrains). Currently, KotlinDL is in Alpha. It's a high-level deep learning API inspired by Keras and built on top of the Tensorflow 1.15 Java API. As the network for this task, we're going to use a fully-connected deep neural network consisting of an Input, a Flatten, two Dense, and an Output (also Dense) Layer. For training, we use the Adam Optimizer in standard configuration with the softmax cross-entropy loss function and accuracy as the metric. The 'summary' function prints out the model architecture. To train the model, we use the 'fit' function. Finally, we evaluate the model on the test set with the 'evaluate' function.
KotlinDL GitHub repo:
github.com/JetBrains/KotlinDL
IntelliJ IDEA Community Version:
www.jetbrains.com/idea/
0:00 Introduction
0:14 Project Setup
1:21 KotlinDL Framework
2:20 Task Description
2:34 MNIST Dataset
3:19 Model Creation
5:08 Model Summary, Training, and Evaluation
6:11 Results
6:58 Outro
@kotlin.learnings on Instagram:
/ kotlin.learnings
@java.learnings on Instagram:
/ java.learnings
Thank you for watching!
Hey guys, those are the dependencies:
dependencies {
implementation("org.slf4j:slf4j-api:1.7.26")
implementation("org.slf4j:slf4j-simple:1.7.26")
implementation("org.jetbrains.kotlinx:kotlin-deeplearning-api:0.2.0")
}
Please share your thoughts and feedback in the comments! My idea for the next video is to create a convolutional neural network to improve upon the results of this video. Does that sound interesting to you guys?
Please, give us the example of this image for tests. Thank you so much!
@@artsbrand I’ll create a GitHub with the code and data, okay?
@@ldickmanns ok, thank you so much
I reproduced this tutor and had same result! Thanks a lot for the tutorial!
Awesome! Was it easy to follow along?
@@ldickmannsYes, make pls more tutorials by this theme
Hi, I have a Mac with M1 and I have tried to use this library but it does not work, maybe could you tell me how to fix it?
The library is quite new. Probably it’ll take some time. I also tried running it on GPU, but it didn’t work with my CUDA and cuDNN version. After asking in the #kotlindl Channel in Kotlin Slack, they told me that it’ll work with a future version. I can ask there for you if you want, but you can also join and ask yourself if you want. Does TensorFlow work in Python on your Mac?
I tried but doesnt work. Could you share this project?
Does it work for you with this project: github.com/ldickmanns/deep-learning-in-kotlin