mirror of
https://github.com/helblazer811/ManimML.git
synced 2025-08-06 17:29:45 +08:00
25 lines
895 B
Python
25 lines
895 B
Python
from manim import *
|
|
from PIL import Image
|
|
|
|
from manim_ml.neural_network.layers.convolutional_2d import Convolutional2DLayer
|
|
from manim_ml.neural_network.layers.feed_forward import FeedForwardLayer
|
|
from manim_ml.neural_network.layers.image import ImageLayer
|
|
from manim_ml.neural_network.neural_network import NeuralNetwork
|
|
|
|
class ConvolutionalNetworkScene(Scene):
|
|
|
|
def construct(self):
|
|
# Make nn
|
|
nn = NeuralNetwork([
|
|
Convolutional2DLayer(1, 7, 3, filter_spacing=0.32),
|
|
Convolutional2DLayer(3, 5, 3, filter_spacing=0.32),
|
|
Convolutional2DLayer(5, 3, 3, filter_spacing=0.18),
|
|
FeedForwardLayer(3),
|
|
FeedForwardLayer(3),
|
|
],
|
|
layer_spacing=0.25,
|
|
)
|
|
# Center the nn
|
|
nn.move_to(ORIGIN)
|
|
self.add(nn)
|
|
self.play(nn.make_forward_pass_animation()) |