helblazer811 / ManimML

ManimML is a project focused on providing animations and visualizations of common machine learning concepts with the Manim Community Library.
MIT License
2.35k stars 140 forks source link

Allow for passing layers as a dictionary. #23

Closed helblazer811 closed 1 year ago

helblazer811 commented 1 year ago

Allow for passing layers as a dictionary as follows:

nn = NeuralNetwork({
    "image_layer": ImageLayer(numpy_image, height=1.5),
    "conv_1_layer": Convolutional2DLayer(1, 7, 3, filter_spacing=0.32),
    "feed_forward_1_layer": FeedForwardLayer(3),
  },
  layer_spacing=0.25,
)

The main purpose of this is so that we can add operations later on that reference the layers by name like adding a residual connection nn.add_connection("image_layer", "feed_forward_1_layer").

helblazer811 commented 1 year ago

This should be good now.