{"name":"ManimML: Visualizing Machine Learning Concepts with Manim Animations","description":"ManimML is an open-source project that offers powerful animations and visualizations for common machine learning concepts, built upon the Manim Community Library. It aims to provide a compilation of primitive visualizations that can be easily combined to explain complex ML ideas, allowing users to focus on explanations rather than software engineering. The library simplifies the creation of engaging educational content for neural networks, convolutional layers, and more.","github":"https://github.com/helblazer811/ManimML","url":"https://osrepos.com/repo/helblazer811-manimml","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/helblazer811-manimml","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/helblazer811-manimml.md","json":"https://osrepos.com/repo/helblazer811-manimml.json","topics":["3blue1brown","machine-learning","manim","neural-network","visualization","Python","Animation","Education"],"keywords":["3blue1brown","machine-learning","manim","neural-network","visualization","Python","Animation","Education"],"stars":null,"summary":"ManimML is an open-source project that offers powerful animations and visualizations for common machine learning concepts, built upon the Manim Community Library. It aims to provide a compilation of primitive visualizations that can be easily combined to explain complex ML ideas, allowing users to focus on explanations rather than software engineering. The library simplifies the creation of engaging educational content for neural networks, convolutional layers, and more.","content":"## Introdução\nManimML is a project dedicated to creating stunning animations and visualizations of common machine learning concepts using the Manim Community Library. The goal is to offer a collection of fundamental visualizations that can be readily combined to produce videos explaining intricate machine learning ideas. This project also provides abstractions, enabling users to concentrate on educational content rather than the underlying software engineering. ManimML has even been featured in a [paper](https://arxiv.org/abs/2306.17108){:target=\"_blank\"}, highlighting its contribution to communicating machine learning architectures.\n\n## Instalação\nTo get started with ManimML, you first need to install the Manim Community edition. Ensure it's not the original 3Blue1Brown Manim version.\nYou can find detailed installation instructions for Manim [here](https://docs.manim.community/en/stable/installation.html){:target=\"_blank\"}.\n\nOnce Manim is installed, you can install ManimML via pip:\nbash\npip install manim_ml\n\nNote that some recent features might only be available if you install directly from the source.\n\n## Exemplos\nManimML provides a straightforward way to visualize various machine learning architectures and processes. Here are some examples:\n\n**First Neural Network (Convolutional Neural Network)**\nThis example demonstrates how to visualize a Convolutional Neural Network and animate its forward pass.\npython\nfrom manim import *\nfrom manim_ml.neural_network import Convolutional2DLayer, FeedForwardLayer, NeuralNetwork\n\nconfig.pixel_height = 700\nconfig.pixel_width = 1900\nconfig.frame_height = 7.0\nconfig.frame_width = 7.0\n\nclass BasicScene(ThreeDScene):\n    def construct(self):\n        nn = NeuralNetwork([\n                Convolutional2DLayer(1, 7, 3, filter_spacing=0.32),\n                Convolutional2DLayer(3, 5, 3, filter_spacing=0.32),\n                Convolutional2DLayer(5, 3, 3, filter_spacing=0.18),\n                FeedForwardLayer(3),\n                FeedForwardLayer(3),\n            ],\n            layer_spacing=0.25,\n        )\n        nn.move_to(ORIGIN)\n        self.add(nn)\n        forward_pass = nn.make_forward_pass_animation()\n        self.play(forward_pass)\n\nTo render this, save the code as `example.py` and run:\nbash\nmanim -pql example.py\n\n![Convolutional Neural Network](assets/readme/convolutional_neural_network.gif)\n\n**A Simple Feed Forward Network**\nVisualize a basic feed-forward neural network by defining its layers.\npython\nfrom manim_ml.neural_network import NeuralNetwork, FeedForwardLayer\n\nnn = NeuralNetwork([\n    FeedForwardLayer(num_nodes=3),\n    FeedForwardLayer(num_nodes=5),\n    FeedForwardLayer(num_nodes=3)\n])\nself.add(nn)\n\n![Simple Feed Forward Network](assets/readme/a_simple_feed_forward_neural_network.png)\n\n**Animating the Forward Pass**\nAutomatically animate the data flow through your neural network.\npython\nfrom manim_ml.neural_network import NeuralNetwork, FeedForwardLayer\n\nnn = NeuralNetwork([\n    FeedForwardLayer(num_nodes=3),\n    FeedForwardLayer(num_nodes=5),\n    FeedForwardLayer(num_nodes=3)\n])\nself.add(nn)\nforward_pass_animation = nn.make_forward_pass_animation()\nself.play(forward_pass_animation)\n\n![Animating Forward Pass](assets/readme/animating_the_forward_pass.gif)\n\n**Convolutional Neural Networks with an Image**\nFeed an image into a convolutional neural network and visualize its processing.\npython\nimport numpy as np\nfrom PIL import Image\nfrom manim_ml.neural_network import NeuralNetwork, FeedForwardLayer, Convolutional2DLayer, ImageLayer\n\nimage = Image.open(\"digit.jpeg\") # You will need to download an image of a digit.\nnumpy_image = np.asarray(image)\n\nnn = NeuralNetwork([\n        ImageLayer(numpy_image, height=1.5),\n        Convolutional2DLayer(1, 7, 3, filter_spacing=0.32),\n        Convolutional2DLayer(3, 5, 3, filter_spacing=0.32),\n        Convolutional2DLayer(5, 3, 3, filter_spacing=0.18),\n        FeedForwardLayer(3),\n        FeedForwardLayer(3),\n    ],\n    layer_spacing=0.25,\n)\nnn.move_to(ORIGIN)\nself.add(nn)\nforward_pass = nn.make_forward_pass_animation()\n\n![CNN with Image](assets/readme/convolutional_neural_network_with_an_image.gif)\n\n**Max Pooling**\nVisualize the 2D Max Pooling operation, a common technique to reduce feature map sizes.\npython\nfrom manim_ml.neural_network import NeuralNetwork, Convolutional2DLayer, MaxPooling2DLayer\n\nnn = NeuralNetwork([\n        Convolutional2DLayer(1, 8),\n        Convolutional2DLayer(3, 6, 3),\n        MaxPooling2DLayer(kernel_size=2),\n        Convolutional2DLayer(5, 2, 2),\n    ],\n    layer_spacing=0.25,\n)\nnn.move_to(ORIGIN)\nself.add(nn)\nforward_pass = nn.make_forward_pass_animation()\nself.wait(1)\nself.play(forward_pass)\n\n![Max Pooling](assets/readme/max_pooling.gif)\n\n**Activation Functions**\nIllustrate different activation functions applied to neural network layers.\npython\nfrom manim_ml.neural_network import NeuralNetwork, Convolutional2DLayer, FeedForwardLayer\n\nnn = NeuralNetwork([\n        Convolutional2DLayer(1, 7, filter_spacing=0.32),\n        Convolutional2DLayer(3, 5, 3, filter_spacing=0.32, activation_function=\"ReLU\"),\n        FeedForwardLayer(3, activation_function=\"Sigmoid\"),\n    ],\n    layer_spacing=0.25,\n)\nself.add(nn)\nforward_pass = nn.make_forward_pass_animation()\nself.play(forward_pass)\n\n![Activation Functions](assets/readme/activation_functions.gif)\n\n**Neural Network Dropout**\nAnimate the dropout regularization technique in a neural network.\npython\nfrom manim_ml.neural_network import NeuralNetwork, FeedForwardLayer\nfrom manim_ml.neural_network.animations.dropout import make_neural_network_dropout_animation\n\nnn = NeuralNetwork([\n        FeedForwardLayer(3),\n        FeedForwardLayer(5),\n        FeedForwardLayer(3),\n        FeedForwardLayer(5),\n        FeedForwardLayer(4),\n    ],\n    layer_spacing=0.4,\n)\nnn.move_to(ORIGIN)\nself.add(nn)\nself.play(\n    make_neural_network_dropout_animation(\n        nn, dropout_rate=0.25, do_forward_pass=True\n    )\n)\nself.wait(1)\n\n![Neural Network Dropout](assets/readme/dropout.gif)\n\n## Porquê usar\nManimML stands out as an invaluable tool for anyone looking to create clear and engaging explanations of machine learning concepts. By leveraging the powerful Manim Community Library, it abstracts away much of the complexity of animation, allowing educators, researchers, and students to focus on the core ideas. Its modular design, with easily combinable primitive visualizations, makes it highly flexible for diverse educational content. Whether you're explaining basic neural networks or complex convolutional architectures, ManimML provides the visual clarity needed to enhance understanding.\n\n## Links\n*   **GitHub Repository:** [https://github.com/helblazer811/ManimML](https://github.com/helblazer811/ManimML){:target=\"_blank\"}\n*   **Academic Paper:** [https://arxiv.org/abs/2306.17108](https://arxiv.org/abs/2306.17108){:target=\"_blank\"}","metrics":{"detailViews":22,"githubClicks":14},"dates":{"published":null,"modified":"2025-11-26T16:01:01.000Z"}}