mirror of
https://github.com/helblazer811/ManimML.git
synced 2025-07-15 07:57:41 +08:00
Used Black to reformat the code in the repository.
This commit is contained in:
@ -2,11 +2,20 @@ from manim import *
|
||||
from matplotlib import animation
|
||||
from manim_ml.neural_network.layers.parent_layers import VGroupNeuralNetworkLayer
|
||||
|
||||
|
||||
class Convolutional2DLayer(VGroupNeuralNetworkLayer):
|
||||
|
||||
def __init__(self, feature_map_height, feature_map_width, filter_width, filter_height,
|
||||
stride=1, cell_width=0.5, feature_map_color=BLUE, filter_color=ORANGE,
|
||||
**kwargs):
|
||||
def __init__(
|
||||
self,
|
||||
feature_map_height,
|
||||
feature_map_width,
|
||||
filter_width,
|
||||
filter_height,
|
||||
stride=1,
|
||||
cell_width=0.5,
|
||||
feature_map_color=BLUE,
|
||||
filter_color=ORANGE,
|
||||
**kwargs
|
||||
):
|
||||
super(VGroupNeuralNetworkLayer, self).__init__(**kwargs)
|
||||
self.feature_map_height = feature_map_height
|
||||
self.feature_map_width = feature_map_width
|
||||
@ -24,10 +33,10 @@ class Convolutional2DLayer(VGroupNeuralNetworkLayer):
|
||||
# Make feature map rectangle
|
||||
self.feature_map = Rectangle(
|
||||
width=self.feature_map_width * self.cell_width,
|
||||
height=self.feature_map_height * self.cell_width,
|
||||
height=self.feature_map_height * self.cell_width,
|
||||
color=self.feature_map_color,
|
||||
grid_xstep=self.cell_width,
|
||||
grid_ystep=self.cell_width
|
||||
grid_ystep=self.cell_width,
|
||||
)
|
||||
|
||||
self.add(self.feature_map)
|
||||
@ -38,4 +47,4 @@ class Convolutional2DLayer(VGroupNeuralNetworkLayer):
|
||||
|
||||
def make_forward_pass_animation(self, **kwargs):
|
||||
"""Make feed forward animation"""
|
||||
return AnimationGroup()
|
||||
return AnimationGroup()
|
||||
|
Reference in New Issue
Block a user