Hinton胶囊网络论文《Dynamic Routing between Capsules》的代码正式开源

 github地址:https://github.com/Sarasra/models/tree/master/research/capsules

运行测试验证设置是否正确,例如:

python layers_test.py

快速MNIST测试结果:

  • 从以下网址下载并提取MNIST记录到 $DATA_DIR/:https://storage.googleapis.com/capsule_toronto/mnist_data.tar.gz

  • 从以下网址下载并提取MNIST模型checkpoint到$CKPT_DIR:                                                                      https://storage.googleapis.com/capsule_toronto/mnist_checkpoints.tar.gz

python experiment.py --data_dir=$DATA_DIR/mnist_data/ --train=false \
--summary_dir=/tmp/ --checkpoint=$CKPT_DIR/mnist_checkpoint/model.ckpt-1

快速CIFAR10 ensemble测试结果:

  • 从以下网址下载并提取cifar10二进制版本到 $DATA_DIR/:https://www.cs.toronto.edu/~kriz/cifar.html

  • 从以下网址下载并提取cifar10模型checkpoint到 $CKPT_DIR:                                                                                https://storage.googleapis.com/capsule_toronto/cifar_checkpoints.tar.gz

  • 将提取的二进制文件的目录作为 data_dir 传递给($ DATA_DIR)

python experiment.py --data_dir=$DATA_DIR --train=false --dataset=cifar10 \
--hparams_override=num_prime_capsules=64,padding=SAME,leaky=true,remake=false \
--summary_dir=/tmp/ --checkpoint=$CKPT_DIR/cifar/cifar{}/model.ckpt-600000 \
--num_trials=7

CIFAR10训练命令:

python experiment.py --data_dir=$DATA_DIR --dataset=cifar10 --max_steps=600000\
--hparams_override=num_prime_capsules=64,padding=SAME,leaky=true,remake=false \
--summary_dir=/tmp/

MNIST的完整训练命令:

  • 在 training-validation pass 训练,validate=true 也是如此

  • 要在一个以上的GPU pass训练,num_gpus = NUM_GPUS

python experiment.py --data_dir=$DATA_DIR/mnist_data/ --max_steps=300000\
--summary_dir=/tmp/attempt0/

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值