# Difference between the code and why is my code wrong

**URL:** <https://community.deeplearning.ai/t/difference-between-the-code-and-why-is-my-code-wrong/734554>\
**Category:** Neural Networks and Deep Learning\
**Tags:** week-module-2, coursera-platform\
**Created:** [December 12, 2024, 1:42pm UTC](https://community.deeplearning.ai/t/difference-between-the-code-and-why-is-my-code-wrong/734554 "2024-12-12T13:42:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [December 12, 2024, 4:16pm UTC](https://community.deeplearning.ai/t/difference-between-the-code-and-why-is-my-code-wrong/734554/2 "2024-12-12T16:16:48Z")

</div>

It is an interesting question that has come up before. It turns out that your method scrambles the data. It depends on the mechanics of how the “reshape” operation works. Just ending up with the correct shape is not good enough. [Here’s a thread](https://community.deeplearning.ai/t/flattening-images-in-the-logistic-regression-assignment-in-course-1-week-2/149) which explains this in detail.

---

_[View the full topic](https://community.deeplearning.ai/t/difference-between-the-code-and-why-is-my-code-wrong/734554)._
