Skip to main content

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 patience parameter from earlier.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autoloss-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autoloss-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file autoloss-1.0.0.tar.gz.

File metadata

  • Download URL: autoloss-1.0.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

Hashes for autoloss-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f2223a811388fe60d8ff5b95b4a153bc89e43c3f2c879e071ceeca29c232e88f
MD5 c6221ef0b8f8d582fc55e5b739204740
BLAKE2b-256 cc7c72417e97a071beb2fc15928fd6e948a13a64228e5b6bb228c296c191f2a1

See more details on using hashes here.

File details

Details for the file autoloss-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: autoloss-1.0.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

Hashes for autoloss-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd2cff65a78664c881603abda4554c9702a564d9d5b25b5d16731997dc5e9dd3
MD5 9479382b4eb985ce9892abb55af1bcbb
BLAKE2b-256 2468b0e06fcf2c20ac56e0442a2eb14b5cc438940698034a7f37aad09b609876

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page