Used Black to reformat the code in the repository.

This commit is contained in:
Alec Helbling
2023-01-01 23:24:59 -05:00
parent 334662e8c8
commit 3d6e8072e1
71 changed files with 1701 additions and 1135 deletions

View File

@ -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()