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-1.0.0.tar.gz (3.3 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-1.0.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for bouncing_decayer_optimizer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d07c6c6ca02c5933a47ef7c9cec11ea1bacfbe45c60b3717e7249f10b5e79835
MD5 c3bd90dabeb809f44a4bcaf866c53631
BLAKE2b-256 eba1df42a33db3b74efa10edf0bf556b5a08a36191609b522b062638a0a52362

See more details on using hashes here.

Provenance

The following attestation bundles were made for bouncing_decayer_optimizer-1.0.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-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bouncing_decayer_optimizer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba296b7549fc3813e0ee9a945d59bc2594e39d8aaa93a1007331df7558e5a62a
MD5 ffea01354f18d1200e762b64f0c963dd
BLAKE2b-256 8696f2a2fddcfe310fee0cfec81ead40d80d2b9becfa31c09376d9cbe955dc77

See more details on using hashes here.

Provenance

The following attestation bundles were made for bouncing_decayer_optimizer-1.0.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