Skip to main content

Brownian diffuser

Project description

brownian-diffuser

Forward integrate torch neural networks

Similar to torchsde.sdeint or torchdiffeq.odeint but for vanilla neural networks as implemented by TorchNets

Example usage

BrownianDiffuser

from brownian_diffuser import BrownianDiffuser

diffuser = BrownianDiffuser()
from torch_nets import TorchNet
import torch

net = TorchNet(50, 50, [400, 400])
X0 = torch.randn([200, 50])
t = torch.Tensor([2, 4, 6])
X_pred = diffuser(net, X0, t, n_steps=40, stdev=0.5, max_steps=None, return_all=False)
X_pred.shape
torch.Size([3, 200, 50])

BrownianMotion

from brownian_diffuser import BrownianMotion

X_state = torch.randn([400, 50])

BM = BrownianMotion(X_state, stdev=0.5, n_steps=40)
Z = BM()
Z.shape
torch.Size([40, 400, 50])

Installation

pip install brownian-diffuser

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

brownian-diffuser-0.0.2.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

brownian_diffuser-0.0.2-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

Supported by

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