whatisgithub

What is optim?

karpathy/optim — explained in plain English

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

42LuaAudience · researcherComplexity · 3/5DormantSetup · moderate

In one sentence

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

What do people build with it?

USE CASE 1

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

USE CASE 2

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

USE CASE 3

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

USE CASE 4

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

What is it built with?

LuaTorch

How does it compare?

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 get it running?

Difficulty · moderate Time to first run · 30min

Requires Torch and a working Lua environment.

Copy-paste 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

What 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.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.