Skip to content

Parameter-free optimization algorithms written for Pytorch.

License

Notifications You must be signed in to change notification settings

Nicolaus93/coin_betting

Repository files navigation

optimal-pytorch

Build Status codecov Maintainability Streamlit App

A library which combines Coin-Betting algorithms and test functions for optimization algorithms.

Install it with pip install optimal_pytorch.

Usage

A minimal example is shown below

import torch
from optimal_pytorch.coin_betting.torch import Cocob

loss_f = lambda x: x**2
y = torch.tensor([20.0], requires_grad=True)
optimizer = Cocob([y])
iterations = 50
for step in range(iterations):
    optimizer.zero_grad()
    loss = loss_f(y)
    loss.backward()
    optimizer.step()
    print(y)

About

Parameter-free optimization algorithms written for Pytorch.

Resources

License

Stars

Watchers

Forks

Packages

No packages published