Omage: Build AI Models in 5 Lines of Python
The Problem
PyTorch is powerful but verbose. Training a simple classifier takes 50+ lines of boilerplate code.
The Solution
I built Omage — a high-level Python library that abstracts PyTorch into readable, concise code.
Before (PyTorch)
python
import torch
import torch.nn as nn
import torch.optim as optim
class Model(nn.Module):
def __init__(self):
super().__init__()
self.layers = nn.Sequential(
nn.Linear(128, 64),
nn.ReLU(),
nn.Dropout(0.2),
nn.Linear(64, 10)
)
def forward(self, x):
return self.layers(x)
model = Model()
optimizer = optim.Adam(model.parameters(), lr=0.001)
criterion = nn.CrossEntropyLoss()
# ... 30 more lines for training loop
##After (Omage)
import omage as og
ai = og.model(
type="classifier",
layers=[og.dense(128), og.dropout(0.2), og.dense(10)],
optimizer=og.adam(lr=0.001),
loss=og.cross_entropy(),
)
ai.train(data, epochs=10)
##Features
Auto GPU detection — runs on CUDA, MPS, or CPU automatically
Model Zoo — load ResNet, GPT-2, BERT, YOLO in one line
CLI — omage run , omage compile , omage zoo list
##Installation
pip install git+https://github.com/Omage-Python-Library/Omage.git
##Quick Start
import omage as og
data = og.load("data.csv").clean().normalize().split(0.8)
model = og.model(
type="classifier",
layers=[og.dense(128), og.dense(10)],
)
model.train(data, epochs=10)
model.save("model.omg")
##Links
GitHub: github.com/Omage-Python-Library/Omage
##Feedback
This is v0.1.1 (alpha). Would love feedback from the community!
Top comments (0)