이 라이브러리는 GPU 지원 및 효율적인 역전술을 갖춘 확률 적 미분 방정식 (SDE) 솔버를 제공합니다.

pip install torchsde요구 사항 : Python> = 3.8 및 Pytorch> = 1.6.0.
여기에서 사용할 수 있습니다.
import torch
import torchsde
batch_size , state_size , brownian_size = 32 , 3 , 2
t_size = 20
class SDE ( torch . nn . Module ):
noise_type = 'general'
sde_type = 'ito'
def __init__ ( self ):
super (). __init__ ()
self . mu = torch . nn . Linear ( state_size ,
state_size )
self . sigma = torch . nn . Linear ( state_size ,
state_size * brownian_size )
# Drift
def f ( self , t , y ):
return self . mu ( y ) # shape (batch_size, state_size)
# Diffusion
def g ( self , t , y ):
return self . sigma ( y ). view ( batch_size ,
state_size ,
brownian_size )
sde = SDE ()
y0 = torch . full (( batch_size , state_size ), 0.1 )
ts = torch . linspace ( 0 , 1 , t_size )
# Initial state y0, the SDE is solved over the interval [ts[0], ts[-1]].
# ys will have shape (t_size, batch_size, state_size)
ys = torchsde . sdeint ( sde , y0 , ts ) examples/demo.ipynb 솔버의 무작위성 고정 및 노이즈 유형 선택과 같은 미묘한 점을 포함하여 SDE를 해결하는 방법에 대한 간단한 안내서를 제공합니다.
examples/latent_sde.py [1]의 섹션 5에서와 같이 잠재적 인 확률 적 미분 방정식을 배웁니다. 이 예제는 SDE에 데이터에 맞는 반면, Ornstein-Uhlenbeck 사전 프로세스와 같도록 규칙화합니다. 이 모델은 사전 및 대략적인 후방이 SDE를 갖는 변형 된 오토 코더로 느슨하게 볼 수 있습니다. 이 예제를 통해 실행할 수 있습니다
python -m examples.latent_sde --train-dir < TRAIN_DIR > 프로그램은 <TRAIN_DIR> 에 의해 지정된 경로에 그림을 출력합니다. 기본 하이퍼 파라미터로 500 번의 반복 후에 훈련이 안정화되어야합니다.
examples/sde_gan.py [2], [3]에서와 같이 SDE를 간으로 배웁니다. 이 예제는 신경 CDE [4]를 판별 자로 사용하는 동안 GAN의 생성기로 SDE를 훈련시킨다. 이 예제를 통해 실행할 수 있습니다
python -m examples.sde_gan이 코드베이스가 연구에 유용하다고 생각되면 다음 중 하나 또는 둘 다를 인용하는 것을 고려하십시오.
@article{li2020scalable,
title={Scalable gradients for stochastic differential equations},
author={Li, Xuechen and Wong, Ting-Kam Leonard and Chen, Ricky T. Q. and Duvenaud, David},
journal={International Conference on Artificial Intelligence and Statistics},
year={2020}
}
@article{kidger2021neuralsde,
title={Neural {SDE}s as {I}nfinite-{D}imensional {GAN}s},
author={Kidger, Patrick and Foster, James and Li, Xuechen and Oberhauser, Harald and Lyons, Terry},
journal={International Conference on Machine Learning},
year={2021}
}
[1] Xuechen Li, Ting-Kam Leonard Wong, Ricky TQ Chen, David Duvenaud. "확률 적 미분 방정식을위한 확장 가능한 그라디언트". 인공 지능 및 통계에 관한 국제 회의. 2020. [Arxiv]
[2] Patrick Kidger, James Foster, Xuechen Li, Harald Oberhauser, Terry Lyons. "무한 차원 가스로서의 신경 SDE". 기계 학습에 관한 국제 회의 2021. [ARXIV]
[3] Patrick Kidger, James Foster, Xuechen Li, Terry Lyons. "신경 SDE의 효율적이고 정확한 그라디언트". 2021. [Arxiv]
[4] Patrick Kidger, James Morrill, James Foster, Terry Lyons, "불규칙한 시계열을위한 신경 제어 미분 방정식". 신경 정보 처리 시스템 2020. [ARXIV]
이것은 공식적인 Google 제품이 아닌 연구 프로젝트입니다.