Giter VIP home page Giter VIP logo

Comments (3)

Arbaaz-Mahmood avatar Arbaaz-Mahmood commented on May 28, 2024

Here is some code I wrote for a generic model training class in manim:

`from manim import *

class ModelTraining(Scene):
def construct(self):
model_title = TextMobject("Model Training")
self.play(Write(model_title))
self.wait()

    training_data = TextMobject("Training Data")
    self.play(Write(training_data))
    self.wait()

    model_training = TextMobject("Training the Model")
    self.play(Write(model_training))
    self.wait()

    accuracy = TextMobject("Accuracy:")
    accuracy_value = TextMobject("100%")
    accuracy_group = VGroup(accuracy, accuracy_value)
    accuracy_group.arrange(RIGHT)
    accuracy_group.to_edge(UP)
    self.play(Write(accuracy_group))
    self.wait()

    testing_data = TextMobject("Testing Data")
    self.play(Write(testing_data))
    self.wait()

    model_testing = TextMobject("Testing the Model")
    self.play(Write(model_testing))
    self.wait()

    test_accuracy = TextMobject("Test Accuracy:")
    test_accuracy_value = TextMobject("99%")
    test_accuracy_group = VGroup(test_accuracy, test_accuracy_value)
    test_accuracy_group.arrange(RIGHT)
    test_accuracy_group.to_edge(UP)
    self.play(Write(test_accuracy_group))
    self.wait()

`

from manimml.

Arbaaz-Mahmood avatar Arbaaz-Mahmood commented on May 28, 2024

Here is an example of a simple transformer model implemented which inherits from this class:
`from manim import *
class TransformerModelScene(ModelTrainingScene):
def init(self, **kwargs):
ModelTrainingScene.init(self, **kwargs)
def setup(self):
self.prepare_data()
self.add_data_points()
self.add_transformer_model()
def prepare_data(self):
# Prepare the data for the Transformer model
pass
def add_transformer_model(self):
# Add the Transformer model to the scene
pass
class TransformerModelTraining(Scene):
def construct(self):
self.add(TransformerModelScene())

`
In this example, TransformerModelScene is a subclass of ModelTrainingScene and inherits all of its methods and attributes. The setup method is overridden to prepare the data for the Transformer model and add the model to the scene.

In the TransformerModelScene class, the prepare_data and add_transformer_model methods need to be implemented to prepare the data for the Transformer model and add the model to the scene, respectively.

Finally, TransformerModelTraining is a scene that adds the TransformerModelScene to the animation.

from manimml.

helblazer811 avatar helblazer811 commented on May 28, 2024

Interesting ideas! I'm especially excited by the idea of creating more animations like ForwardPass with similar syntax to how the animations are done in the core library.

from manimml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.