# Why the result from Flux.jl is totally different from tf.Keras (with the same simple MLP)

**URL:** <https://discourse.julialang.org/t/why-the-result-from-flux-jl-is-totally-different-from-tf-keras-with-the-same-simple-mlp/31739>\
**Category:** Machine Learning\
**Tags:** question, package\
**Created:** [December 2, 2019, 9:46am UTC](https://discourse.julialang.org/t/why-the-result-from-flux-jl-is-totally-different-from-tf-keras-with-the-same-simple-mlp/31739 "2019-12-02T09:46:58Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![dellison](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dellison](https://discourse.julialang.org/u/dellison)\
**Post date:** [December 3, 2019, 12:11am UTC](https://discourse.julialang.org/t/why-the-result-from-flux-jl-is-totally-different-from-tf-keras-with-the-same-simple-mlp/31739/6 "2019-12-03T00:11:19Z")

</div>

There was a similar question posted here a little while ago, and in that situation, it seemed to be the case that keras was using a batch size of 32 by default and Flux wasn’t, and that was where the difference in behavior was coming from. I wonder if you’re seeing the same thing.

Here’s a link to that thread- the post just below this one has a version of the original author’s code that matches the keras/tf behavior.

> [@The same network performs differently in Flux.jl and tensorflow](https://discourse.julialang.org/t/the-same-network-performs-differently-in-flux-jl-and-tensorflow/28378/5):
>
> Could the batch size be an issue? It seems that keras defaults to 32 if unspecified ([The Model class](https://keras.io/models/model/)).

Hope that helps! 🙂

---

_[View the full topic](https://discourse.julialang.org/t/why-the-result-from-flux-jl-is-totally-different-from-tf-keras-with-the-same-simple-mlp/31739)._
