Skip to content

Instantly share code, notes, and snippets.

View EteimZ's full-sized avatar

Youdiowei Eteimorde EteimZ

View GitHub Profile
@EteimZ
EteimZ / relu_manim.py
Created January 20, 2025 11:33
ReLU graph animation using manim
class ReLU(Scene):
"""
Animation of Rectified Linear Unit activation function
used in Neural Networks.
"""
def construct(self):
# Define graph axes
axes = Axes(
x_range = [-10, 10, 1],
y_range = [0, 6, 1],
@EteimZ
EteimZ / information_suprise.py
Created January 20, 2025 11:31
This animation is used to show the Probability vs Suprise Graph using manim.
class Suprise(Scene):
"""
This animation is used to show the Probability vs Suprise Graph.
The graph shows the inverse relationship between Probability and
Suprise.
"""
def construct(self):
# Define the graph axes
from manim import *
class SimpleFrequency(Scene):
def construct(self):
ax = Axes(
x_range=[-10, 10.3, 1],
y_range=[-1.5, 1.5, 1],
x_length=10,
x_axis_config={
"numbers_to_include": np.arange(-10, 10.01, 2)
@EteimZ
EteimZ / Lora_inference.py
Created July 27, 2024 17:30
This is a manim visualization for LoRA inference.
class Inference(Scene):
def construct(self):
title = Title("LoRA Inference", include_underline=False).scale(0.75)
self.add(title)
# This computes the values of the matrices used in the animation
self.computation()
@EteimZ
EteimZ / unit_circle.py
Created July 16, 2024 15:14
Unit circle animation in manim.
from manim import *
class UnitCircle(MovingCameraScene):
def construct(self):
title = Title("The Unit Circle", include_underline=False)
circle = Circle()
numberplane = NumberPlane()
line = Line(ORIGIN, np.array([1.0, 0, 0]))
dot = Dot().move_to(np.array([1.0, 0, 0]))
@EteimZ
EteimZ / dailout.md
Created May 2, 2024 06:38
Make serial port work on linux by adding user to dailout group

Serial Port Setup

When you install arduino IDE the serial port is usually not visible. This command helps with setting it up.

sudo adduser <username> dialout
sudo chmod a+rw /dev/ttyUSB0
@EteimZ
EteimZ / index.html
Created January 25, 2024 11:22
Moving box in HTML5 canvas
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Moving Box</title>
</head>
<body>
<canvas id="draw"></canvas>
@EteimZ
EteimZ / part_2.py
Last active February 5, 2024 06:48
Code snippets from my youtube series: Implementing a file system.
"""
A file system is the interface between a user and their storage device.
features:
Non-contiguous
Single-level directory
Storage device
Block
File system
@EteimZ
EteimZ / ussd.js
Created January 9, 2024 01:11
A simple command line application behaving like a USSD application
// import the readline module to get user input
readline = require('node:readline')
class BankUSSD {
main(){
// Define the variable that will be used to get user input
const userInput = readline.createInterface({
input: process.stdin,
output: process.stdout,
@EteimZ
EteimZ / log_function_call.py
Created December 30, 2023 11:18
A decorator that keep track of a function when it has been called. This is good for viewing recursion
import functools
def log_function_call(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
print(f"Calling {func.__name__} with args: {args}, kwargs: {kwargs}")
result = func(*args, **kwargs)
print(f"{func.__name__} returned: {result}")
return result
return wrapper