Skip to content

Instantly share code, notes, and snippets.

View piotrek124-1's full-sized avatar

Piotr Mikuła piotrek124-1

View GitHub Profile
@piotrek124-1
piotrek124-1 / Code
Last active May 27, 2023 09:01
Simple neural network in Julia
using Flux, MLDatasets, CUDA, FileIO
using Flux: train!, onehotbatch
x_train, y_train = MLDatasets.MNIST.traindata()
x_test, y_test = MLDatasets.MNIST.testdata()
x_train = Float32.(x_train)
y_train = Flux.onehotbatch(y_train, 0:9)
model = Chain(
Dense(784, 256, relu),
Dense(256, 10, relu), softmax