跨域半监督自适应学习

torch-salad的Python项目详细描述


沙拉
==

**s**\emi监督**a**\daptive**l**\earning**a**\cross**d**\omains

图:img/domainshift.png
:alt:



``salar``是一个库,可以使用当前的领域适应技术轻松设置实验。它具有几种
最新的方法,目的是能够在算法之间进行公平的比较
,并将它们转移到现实世界的用例中。
工具箱正在积极开发中,并将在新的
方法发布时进行扩展。


在github上发表文章:`https://github.com/domainadaptation/salad`\br/>

`arxiv:1802.08735<;https://arxiv.org/abs/1802.08735>;`
-dirt-t(``dirttsolver`)、
`arxiv:1802.08735<;https://arxiv.org/abs/1802.08735>;`
-用于可视域自适应的自增强
(``selfensblingsolver`)
`arxiv:1706.05208<;https://arxiv.org/abs/1706.05208>;`
-关联域适配(` ` associativesolver``)、
`arxiv:1708.00938<;https://arxiv.org/pdf/1708.00938.pdf>;`
-域对抗训练(``dannsolver`)、
`jmlr:v17/15-239.html<;http://jmlr.org/papers/v17/15-239.html>;``跨梯度训练跨域泛化
(``跨梯度求解器``)、
` arxiv:1708.00938<;http://arxiv.org/abs/1804.10745>;``逆退出规则化(``逆退出解决器``),
`arxiv.org:1711.01575<;https://arxiv.org/abs/1711.01575>;`

实现了以下功能(在``salar.layers```中):

-使用指数移动平均值进行权重累积或存储
权重
-walkerloss和访问损失
(`arxiv:1708.00938<;https://arxiv.org/pdf/1708.00938.pdf>;``uxiv
-虚拟对抗训练
(`arxiv:1704.03976<;https://arxiv.org/abs/1704.03976>;``uxiv

即将推出:

-深度联合优化运输(``djdotsolver`)、
`arxiv:1803.10081<;https://arxiv.org/abs/1803.10081>;`_
-基于翻译的方法

最新的结果可以通过``scripts/``
目录中的文件进行复制。图:img/benchmarks.svg
:alt:



代码::bash

pip install-r requirements.txt


代码::bash

pip install torch salad


对于最新的开发版本,请通过

安装。代码::bash

pip安装git+https://github.com/bethgelab/domain adaptation


这个
库包含在
general中轻松设置深度学习实验的代码。

此部分将在预发布时扩展。


快速启动
~~~~~~~~~~~~~~

开始,"`scripts/`"目录包含几个python脚本
,用于运行数字基准的复制研究和对不同数据集的研究(例如:对噪声图像的适应)。

代码::bash

$cd scripts
$python train_digits.py--log./log--teach--source svhn--target mnist

有关所有选项,请参阅帮助页:

。代码:

用法:train_digits.py[-h][--gpu gpu][--cpu][--njobs njobs][--log log]
[--epochs epochs][--checkpoint checkpoint]
[--learningrate learningrate][--dryrun]
[--source{mnist,svhn,usps,synth,synth small}]
[--target{mnist,svhn,usps,synth,synth small}]
[--sourcebatch sourcebatch][--targetbatch targetbatch]
[--seed seed][--print][--null][--adv][--vada]
[--dann][--assoc][--coral][--teach]

--帮助显示此帮助消息并退出
--GPU GPU指定GPU
--CPU使用CPU培训
--njobs njobs每个数据加载器的进程数
--日志日志日志目录。如果不存在
--epochs epochs epochs数量(完全通过无监督的
培训集)
--检查点检查点
检查点路径
--学习率学习率
亚当的学习率。默认为karpathy的
常量;-)
--dryrun执行测试运行,而不实际训练
网络。
--源{mnist,svhn,usps,synth,synth small}
源数据集。选择mnist或svhn
--目标{mnist,svhn,usps,synth,synth small}
目标数据集。选择mnist或svhn
--source batch sourcebatch
source的批大小
--targetbatch targetbatch
target的批大小
--种子随机种子
--打印
--null
--adv训练具有对抗域正则化的模型
--VADA训练具有虚拟对抗域的模型
自适应
--DANN训练具有域对抗训练的模型
--ASSOC训练具有关联域适配
--coral训练具有深度相关对齐的模型
--教导训练具有自相关的模型





使用解算器抽象的原因
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

抽象样式将实验组织到
``solver``.

quickstart:mnist experiment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

代码::python

from salad.solvers import solver


class mnistsolver(solver):


self.model=model
super()。\uu初始(dataset,**kwargs)

def初始优化(self,lrr=1e-4,**kwargs):
super()。\u init_optims(**kwargs)

opt=torch.optim.adam(self.model.parameters(),lr=lr)
self.register_optimizer(opt)

def_init_loss(self):
pass


与其他
pytorch示例"todo<;>;` uuuu.

在建()

`_


>
-合成(gan)-合成(gan)-真实(128679;)
-cifar-cifar-stl(128679;)
-imagenet-imagenet-to
`icubworld<;https://robotogolology.github.io/icubworld/icubworld/datasets>;` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` icubworld<;https://robotolology.github.io/icubworld/datadatasets>;` ` ` ` ` ` ` ` ` `mozilla.org/>;`_()

开放源代码软件
特别是:

-https://github.com/britefury/self-ensemble-visual-domain-adapt
-https://github.com/britefury/self-ensemble-visual-domain-adapt-photo/
-https://github.com/ruishu/dirt
-https://github.com/gpascualg/crossgrad
-https://github.com/stes/torch associative
-https://github.com/haeusser/learning\\\\\\&u association
-https://mil tokyo.github.io/adr\&u da/

联系人:由"steffen schneider<;https://code.stes.io>;"维护。这项工作是我在"贝斯格实验室"的论文项目的一部分。此
自述文件也可以作为网页在
`salad.domainadaptation.org<;http://salad.domainadaptation.org>;`uu'上找到。我们
欢迎发布并将请求"拉到正式的github
存储库<;https://github.com/bethgelab/domainadaptation>;``uu.




欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java中ArrayList的超简单问题   Java 8在一段时间后过期   java如何创建具有用户定义维度的矩阵,并使用从上到下、从左到右的递增值填充它?   java从JDBC重启mysql   带有sqlite的java LiveData未更新UI   带有JDialog的java小程序在Mac OSX中未正确隐藏   java ActionListener无法从公共类引用数组?   java Apache Digester:NoSuchMethodException:没有这样的可访问方法   安卓中数据库中的java数据没有以正确的格式检索   java快速排序实现:使用random pivot时几乎排序   安卓 Java:高效的ArrayList过滤?   java如何在单独的文件中制作GUI程序   jasper报告如何从JSP或Java代码在JasperReport中传递参数值?