Added new video to readme

This commit is contained in:
Alec Helbling
2022-04-04 23:25:04 -04:00
parent f282c3e7a6
commit 93a0bf64c5
3 changed files with 43 additions and 10 deletions

View File

@ -5,7 +5,7 @@
[![GitHub license](https://img.shields.io/github/license/helblazer811/ManimMachineLearning)](https://github.com/helblazer811/ManimMachineLearning/blob/main/LICENSE.md) [![GitHub license](https://img.shields.io/github/license/helblazer811/ManimMachineLearning)](https://github.com/helblazer811/ManimMachineLearning/blob/main/LICENSE.md)
[![GitHub tag](https://img.shields.io/github/v/release/helblazer811/ManimMachineLearning)](https://img.shields.io/github/v/release/helblazer811/ManimMachineLearning) [![GitHub tag](https://img.shields.io/github/v/release/helblazer811/ManimMachineLearning)](https://img.shields.io/github/v/release/helblazer811/ManimMachineLearning)
[![Github All releases](https://img.shields.io/github/downloads/helblazer811/ManimMachineLearning/total)](https://GitHub.com/helblazer811/ManimMachineLearning/releases/) ![Pypi Downloads](https://img.shields.io/pypi/dm/manim-ml)
[![Follow Twitter](https://img.shields.io/twitter/follow/alec_helbling?style=social)](https://twitter.com/alec_helbling) [![Follow Twitter](https://img.shields.io/twitter/follow/alec_helbling?style=social)](https://twitter.com/alec_helbling)
Manim Machine Learning is a project focused on providing animations and visualizations of common machine learning concepts with the [Manim Community Library](https://www.manim.community/). We want this project to be a compilation of primitive visualizations that can be easily combined to create videos about complex machine learning concepts. Additionally, we want to provide a set of abstractions which allow users to focus on explanations instead of software engineering. Manim Machine Learning is a project focused on providing animations and visualizations of common machine learning concepts with the [Manim Community Library](https://www.manim.community/). We want this project to be a compilation of primitive visualizations that can be easily combined to create videos about complex machine learning concepts. Additionally, we want to provide a set of abstractions which allow users to focus on explanations instead of software engineering.
@ -16,7 +16,12 @@ Manim Machine Learning is a project focused on providing animations and visualiz
2. [Examples](#examples) 2. [Examples](#examples)
## Getting Started ## Getting Started
First you will want to [install manim](https://docs.manim.community/en/stable/installation.html). Then you can run the following to generate the example videos. First you will want to [install manim](https://docs.manim.community/en/stable/installation.html).
Then install the package form source or
`pip install manim_ml`
Then you can run the following to generate the example videos from python scripts.
`manim -pqh src/vae.py VAEScene` `manim -pqh src/vae.py VAEScene`
@ -24,20 +29,49 @@ First you will want to [install manim](https://docs.manim.community/en/stable/in
Checkout the ```examples``` directory for some example videos with source code. Checkout the ```examples``` directory for some example videos with source code.
### Neural Networks
This is a visualization of a Neural Network made using ManimML. It has a Pytorch style list of layers that can be composed in arbitrary order. The following video is made with the code from below.
<img src="examples/media/ImageNeuralNetworkScene.gif">
```python
from manim import *
from manim_ml.neural_network.layers import FeedForwardLayer, ImageLayer
from manim_ml.neural_network.neural_network import NeuralNetwork
from PIL import Image
import numpy as np
class ImageNeuralNetworkScene(Scene):
def construct(self):
image = Image.open('images/image.jpeg')
numpy_image = np.asarray(image)
# Make nn
layers = [
ImageLayer(numpy_image, height=1.0),
FeedForwardLayer(3),
FeedForwardLayer(5),
FeedForwardLayer(3)
]
nn = NeuralNetwork(layers)
# Center the nn
nn.move_to(ORIGIN)
self.add(nn)
# Play animation
self.play(nn.make_forward_pass_animation())
```
### Variational Autoencoders ### Variational Autoencoders
This is a visualization of a Variational Autoencoder. This is a visualization of a Variational Autoencoder.
<img src="examples/media/VAEScene.gif" width="600"> <img src="examples/media/VAEScene.gif">
### VAE Disentanglement ### VAE Disentanglement
This is a visualization of disentanglement with a Variational Autoencoder This is a visualization of disentanglement with a Variational Autoencoder
<img src="examples/media/DisentanglementScene.gif" width="600"> <img src="examples/media/DisentanglementScene.gif">
### Neural Networks
This is a visualization of a Neural Network.
<img src="examples/media/TestNeuralNetworkScene.gif" width="600">

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 KiB

View File

@ -44,7 +44,6 @@ class ImageNeuralNetworkScene(Scene):
ImageLayer(numpy_image, height=1.0), ImageLayer(numpy_image, height=1.0),
FeedForwardLayer(3), FeedForwardLayer(3),
FeedForwardLayer(5), FeedForwardLayer(5),
FeedForwardLayer(3),
FeedForwardLayer(3) FeedForwardLayer(3)
] ]
nn = NeuralNetwork(layers) nn = NeuralNetwork(layers)