# Simple Model for CIFAR-10 using Flux not converging

**URL:** <https://discourse.julialang.org/t/simple-model-for-cifar-10-using-flux-not-converging/96168>\
**Category:** Machine Learning\
**Tags:** flux\
**Created:** [March 16, 2023, 9:04am UTC](https://discourse.julialang.org/t/simple-model-for-cifar-10-using-flux-not-converging/96168 "2023-03-16T09:04:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iskyd](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iskyd/32/44797_2.png) [@iskyd](https://discourse.julialang.org/u/iskyd)\
**Post date:** [March 16, 2023, 9:04am UTC](https://discourse.julialang.org/t/simple-model-for-cifar-10-using-flux-not-converging/96168/1 "2023-03-16T09:04:42Z")

</div>

I’m trying to train a simple model on the CIFAR-10 dataset.  
I’m using the model proposed by the flux documentation on cifar-10 found here: [Deep Learning with Julia & Flux: A 60 Minute Blitz · Flux](https://fluxml.ai/Flux.jl/stable/tutorials/2020-09-15-deep-learning-flux/)

[This is my code.](https://gist.github.com/iskyd/6d46f1d590467b0174dd31799de7897e)

When training it I got 50% accuracy after 10 iterations but it doesn’t improve much after next iterations. For example after 35 iterations I got around 0.56% accuracy.

How can I improve the model to converge on this simple dataset? I’m doing something wrong?

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [March 18, 2023, 10:10pm UTC](https://discourse.julialang.org/t/simple-model-for-cifar-10-using-flux-not-converging/96168/2 "2023-03-18T22:10:14Z")

</div>

Your training code currently differentiates through the augmentation and I’m not sure it should be. Have you tried removing the augmentation from the loss function?
