AutoLoss is a complex optimizer that uses Artifical Intelligence to optimize your neural network
Project description
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
patienceparameter from earlier.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autoloss-1.1.0.tar.gz.
File metadata
- Download URL: autoloss-1.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3c3b9d96c4acc8deb86da70bd84c714fa431b61cf3e9cf45e08e1016aaaa81c
|
|
| MD5 |
8ab2ae4e616a3aadfc039d7ac4af0c3e
|
|
| BLAKE2b-256 |
cdb9e1bce7ebccad633379852810c39e7b45ab2f296bc0c9cc5c48cb9ac5f0f6
|
File details
Details for the file autoloss-1.1.0-py3-none-any.whl.
File metadata
- Download URL: autoloss-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be8740e2fcf3ad9103515187beb6dcc589538643c28a198a007f22ca8eb95038
|
|
| MD5 |
72179857a85a5dfecd8f97d934007980
|
|
| BLAKE2b-256 |
254425ef55d822d0107bafc723643419244887d11abf826d06b52de19ed4738f
|