diff --git a/Readme.md b/Readme.md index e69de29..3aa16bf 100644 --- a/Readme.md +++ b/Readme.md @@ -0,0 +1,26 @@ +# Manim Machine Learning + +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. + +## Getting Started +First you will want to install manim. Then you can run the following to generate the example videos. + +`make video` + +or + +`manim -pqh src/vae.py VAEScene` + +## Examples + +### Variational Autoencoders + +This is a visualization of a Variational Autoencoder. You can also find a video form in examples/ + + + +### Neural Networks + +This is a visualization of a Neural Network. You can find a video animation of a neural network in examples/ + + diff --git a/examples/NNImage.png b/examples/NNImage.png new file mode 100644 index 0000000..8617e13 Binary files /dev/null and b/examples/NNImage.png differ diff --git a/examples/VAEImage.png b/examples/VAEImage.png new file mode 100644 index 0000000..5279ecd Binary files /dev/null and b/examples/VAEImage.png differ diff --git a/src/neural_network.py b/src/neural_network.py index e90df75..27f1fe2 100644 --- a/src/neural_network.py +++ b/src/neural_network.py @@ -134,6 +134,11 @@ class NeuralNetwork(VGroup): return animation_group +config.pixel_height = 720 +config.pixel_width = 1280 +config.frame_height = 6.0 +config.frame_width = 6.0 + class TestNeuralNetworkScene(Scene): """Test Scene for the Neural Network""" diff --git a/src/vae.py b/src/vae.py index bfc2d33..42fa46d 100644 --- a/src/vae.py +++ b/src/vae.py @@ -297,3 +297,18 @@ class VAEScene(Scene): interpolation_images = mnist_image_handler.interpolation_images interpolation_animation = vae.make_interpolation_animation(interpolation_images) self.play(interpolation_animation) + +class VAEImage(Scene): + + def construct(self): + # Set Scene config + vae = VariationalAutoencoder() + mnist_image_handler = MNISTImageHandler() + image_pair = mnist_image_handler.image_pairs[3] + vae.move_to(ORIGIN) + vae.scale(1.3) + self.play(Create(vae), run_time=3) + # Make a forward pass animation + forward_pass_animation = vae.make_forward_pass_animation(image_pair) + self.play(forward_pass_animation) + \ No newline at end of file