perturbations-differential-pytorch:在Pytorch中具有扰动的可微分优化器

时间:2021-04-01 16:09:43
【文件属性】:
文件名称:perturbations-differential-pytorch:在Pytorch中具有扰动的可微分优化器
文件大小:14KB
文件格式:ZIP
更新时间:2021-04-01 16:09:43
Python PyTorch中具有扰动的可微分优化器 这包含Tensorflow中的可的PyTorch实现。 所有版权归原始作者所有,可以在下面找到。 下面给出的源代码,测试和示例是原始作品的一对一副本,但带有纯PyTorch实现。 概述 我们在这项工作中提出了一种通用方法,以可微分的近似方式转换任何优化器。 我们提供了一个PyTorch实施,此处在一些示例中进行了说明。 摄动argmax 我们从一个原始的优化器argmax函数开始,该函数是根据示例输入theta计算的。 import torch import torch . nn . functional as F import perturbations device = torch . device ( "cuda:0" if torch . cuda . is_available () else "cpu" ) def argmax ( x
【文件预览】:
perturbations-differential-pytorch-master
----perturbations.py(8KB)
----.gitignore(33B)
----README.md(9KB)
----example.py(5KB)
----perturbations_test.py(6KB)
----fenchel_young_test.py(3KB)
----fenchel_young.py(3KB)

网友评论