Skip to content

Instantly share code, notes, and snippets.

View WolfByttner's full-sized avatar

Wolf Byttner WolfByttner

View GitHub Profile
@WolfByttner
WolfByttner / mlp.py
Created February 28, 2025 13:07
Sub-ms sine curve prediction (demonstrating M1 hardware performance)
import torch
import torch.nn as nn
import torch.optim as optim
import time
import numpy as np
print("This code example demonstrates how to train a simple MLP model for price prediction using PyTorch.")
print("The model is trained on a sine wave and tested on a shifted sine wave.")
print("The goal is to demonstrate sub-ms latency for price prediction using PyTorch")
print("on Mac M1-M4 with Metal Performance Shaders (MPS) enabled.")
@WolfByttner
WolfByttner / pycon_matlab.py
Last active January 3, 2024 12:52
Python Console Execution with Matplotlib support for SuperFences
"""
Execute Python code in code blocks and construct a interactive Python console output.
This allows you to write code examples, but then execute them, showing the results.
https://github.com/facelessuser/pymdown-extensions/issues/1690
Original Gist: https://gist.github.com/facelessuser/53fa4d93f27c252fda813b5e0ba7325c
Matplotlib Gist: https://gist.github.com/WolfByttner/e0b855e4b80b9742647411c51c8dfe55
---