Skip to main content

A physics-inspired optimizer adding decaying oscillations to gradient descent

Project description

Bouncing Decayer Optimizer

A physics-inspired optimizer for PyTorch — adding decaying oscillations like a bouncing ball.

Gradient descent is great — but it can get stuck or converge too fast.
This optimizer adds a decaying sinusoidal perturbation:

  • Early → big "bounces" help explore.
  • Later → oscillations fade, optimizer settles.

🧰 Usage SOON (Pypi verification pending)

from bouncing_decayer_optimizer import BouncingDecayerOptimizer
import torch

model = torch.nn.Linear(10, 1)
optimizer = BouncingDecayerOptimizer(model.parameters(), lr=0.01)

for epoch in range(100):
    optimizer.zero_grad()
    inputs = torch.randn(32, 10)
    targets = torch.randn(32, 1)
    outputs = model(inputs)
    loss = torch.nn.functional.mse_loss(outputs, targets)
    loss.backward()
    optimizer.step()
    print(f"Epoch {epoch}, Loss: {loss.item()}")

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

bouncing_decayer_optimizer-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

bouncing_decayer_optimizer-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bouncing_decayer_optimizer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a521287236cc19a7f8d2cffabbbcbf8333c071c59e07cba3bad7d4138596eb60
MD5 41c6195709a322c3de00af3cea9ac35d
BLAKE2b-256 5500271b48b61853c3562d38b628eb058b161b29cc2bf95ba0260bea7cf71213

See more details on using hashes here.

Provenance

The following attestation bundles were made for bouncing_decayer_optimizer-0.1.0.tar.gz:

Publisher: publish-to-pypi.yml on sandy1279/bouncing_decayer_optimizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for bouncing_decayer_optimizer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15c9eeeb748da5b229a6379c9f27c3d7b2aef7fcb5893bc18d8b01dfbba0fadd
MD5 b46d8dbcfa9a9bc53729d2dadf43f24c
BLAKE2b-256 98feddddc17d9b34c1bcf080ef5c4deacccfdea8f7af6b2a69f4199ecd08bba2

See more details on using hashes here.

Provenance

The following attestation bundles were made for bouncing_decayer_optimizer-0.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on sandy1279/bouncing_decayer_optimizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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