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-0.1.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-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for autoloss-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6e6faa684f0cb5b56a51bbf9034f823fc684f68e74a44167e09f1e1c5c3760bc
MD5 54f9d0c1931d9d96d968d4e7cd4ffd46
BLAKE2b-256 404a8206402f49d8eedda70bc770dd5209e82f415e6cc42a73ebfe42f1a13509

See more details on using hashes here.

File details

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

File metadata

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

Hashes for autoloss-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15f63e608b21b2347482877d63cb33cc913c96ea823891620fccc1f0861dd9a6
MD5 779237fc069d20fe0852c25b74c00a76
BLAKE2b-256 d9ee8a5e0f17bf5e656abf91aebe542fb938c9b2fc80e1dd1cf54892cff47dbb

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