helblazer811 / ManimML

ManimML is a project focused on providing animations and visualizations of common machine learning concepts with the Manim Community Library.
MIT License
2.35k stars 140 forks source link

correct the "First Neural Network" code #26

Closed chaoshengt closed 1 year ago

chaoshengt commented 1 year ago

Thank you for sharing your job! @helblazer811

The second line of the "First Neural Network"

from manim_ml.neural_network import Convolutional2DLayer, FeedForwardLayer, NeuralNetwork

should be changed as

from manim_ml.neural_network.layers import  Convolutional2DLayer, FeedForwardLayer
from manim_ml.neural_network.neural_network import NeuralNetwork

I hope this project gets better and better.

helblazer811 commented 1 year ago

Thanks so much for the catch! I'm glad you like the project. I think I just forgot to add the manim_ml/neural_network/init.py file which defined all of these import shortcuts in the most recent pypi package. It should be good now if you install again by running pip install --upgrade manim_ml. Let me know if this works, sorry about that.

chaoshengt commented 1 year ago

Thanks so much for the catch! I'm glad you like the project. I think I just forgot to add the manim_ml/neural_network/init.py file which defined all of these import shortcuts in the most recent pypi package. It should be good now if you install again by running pip install --upgrade manim_ml. Let me know if this works, sorry about that.

Yes. It works! It seems that all of them are correct:

Snipaste_2023-01-31_09-12-40

I think it is better to keep only one way to import the code:(Method-A or Method-B).
In my opinion, “Method-B” is better. from "neural_network" module, we can import other network architectures, such as AlexNet, RNN, GCN,or Transformer . from "layers" module, we can import varieties layers of the corresponding architecture.

Of course, the amount of the job is enormous !

Thank you again! :)

helblazer811 commented 1 year ago

I'm glad you appreciate the project. I am planning on adding some additional neural network architectures soon.

I understand it's a bit confusing. The main reason for method-a was to make the imports less complicated for example, so they don't have 5 or 6 lines of imports.

helblazer811 commented 1 year ago

Closing now if this issue is solved.