Skip to main content

AutoLoss

AutoLoss is an optimizer that uses Artificial Intelligence to optimize your neural networks as well as possible.

Usage

First, import the package and other dependencies:

from autoloss import *
import torch
import torch.nn as nn

Then, create your AI Model. For the sake of simplicity, let's just name it model for this example.

Next, initialize a loss function. For this example, we'll use CrossEntropyLoss:

loss_fn = nn.CrossEntropyLoss()

Afterwards, create an instance of the AutoLoss optimizer

optimizer = AutoLoss(model, loss_fn, patience=25)

Note: For more advanced details on the patience argument, check Internal Functioning.

Now, to train the model, just call optimizer.step(x, target), where x is the input data and target is the expected output data.

Internal Functioning

  • AutoLoss uses its own AI model to predict what parameters would work best for your neural network, therefore constantly getting better at predicting better parameters and training your AI better.
  • If AutoLoss's AI can not find any better parameters, it switches to SGD (Stochastic Gradient Descent).
  • The amount of tries AutoLoss's AI has at finding better parameters until it switches to SGD is equal to the patience parameter from earlier.

Metadata

Release files for autoloss 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autoloss 1.1.0
File Size Uploaded
autoloss-1.1.0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autoloss 1.1.0
File Interpreter ABI Platform
autoloss-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.6 kB

Release files / autoloss-1.1.0.tar.gz

Download URL autoloss-1.1.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e3c3b9d96c4acc8deb86da70bd84c714fa431b61cf3e9cf45e08e1016aaaa81c
BLAKE2b-256 checksum
How to use checksums
cdb9e1bce7ebccad633379852810c39e7b45ab2f296bc0c9cc5c48cb9ac5f0f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Windows/11

Release files / autoloss-1.1.0-py3-none-any.whl

Download URL autoloss-1.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be8740e2fcf3ad9103515187beb6dcc589538643c28a198a007f22ca8eb95038
BLAKE2b-256 checksum
How to use checksums
254425ef55d822d0107bafc723643419244887d11abf826d06b52de19ed4738f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Windows/11

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page