gitwtfhub

wtf is optim?

karpathy/optim — explained in plain English

Analysis updated 2026-07-18 · repo last pushed 2021-08-19

42LuaAudience · researcherComplexity · 3/5DormantSetup · moderate

TL;DR

A collection of optimization algorithms (like SGD) for training machine learning models in Torch, a numerical computing framework written in Lua.

Mindmap

mindmap
  root((optim))
    What it does
      Optimization algorithms
      Tunes model parameters
      Reduces training error
    Tech stack
      Lua
      Torch
    Use cases
      Train neural networks
      Image recognition models
      NLP models
    Audience
      ML researchers
      Torch engineers
      Model builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Train a neural network by repeatedly calling an optimizer to adjust its parameters.

REASON 2

Track training progress by recording error values returned on each update step.

REASON 3

Swap in different optimization methods like SGD without changing your training loop.

REASON 4

Persist optimizer state between runs so training can resume where it left off.

What's in the stack?

LuaTorch

How it stacks up

karpathy/optimgregorias/nvim-surround-wknot-manu/filemention.nvim
Stars423558
LanguageLuaLuaLua
Last pushed2021-08-19
MaintenanceDormant
Setup difficultymoderateeasyeasy
Complexity3/51/52/5
Audienceresearcherdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires Torch and a working Lua environment.

Yoink these prompts

Prompt 1
Show me how to set up an SGD training loop using the optim package in Torch.
Prompt 2
Explain how the state table in optim keeps track of an optimizer's internal memory.
Prompt 3
Write a Lua/Torch script that trains a simple image classifier using this optimization package.
Prompt 4
What learning rate settings should I try first when using SGD from this package?

Frequently asked questions

wtf is optim?

A collection of optimization algorithms (like SGD) for training machine learning models in Torch, a numerical computing framework written in Lua.

What language is optim written in?

Mainly Lua. The stack also includes Lua, Torch.

Is optim actively maintained?

Dormant — no commits in 2+ years (last push 2021-08-19).

How hard is optim to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is optim for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.