deeprobust.image.netmodels package¶
Submodules¶
deeprobust.image.netmodels.CNN module¶
This is an implementatio of a Convolution Neural Network with 2 Convolutional layer.
deeprobust.image.netmodels.CNN_multilayer module¶
This is an implementation of Convolution Neural Network with multi conv layer.
deeprobust.image.netmodels.YOPOCNN module¶
Model for YOPO.
deeprobust.image.netmodels.densenet module¶
This is an implementation of DenseNet model.
Reference¶
..[1]Huang, Gao, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q. Weinberger. “Densely connected convolutional networks.” In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4700-4708. 2017. ..[2]Original implementation: https://github.com/kuangliu/pytorch-cifar
deeprobust.image.netmodels.preact_resnet module¶
This is an reimplementaiton of Pre-activation ResNet.
deeprobust.image.netmodels.resnet module¶
Properly implemented ResNet-s for CIFAR10 as described in paper [1].
This implementation is from Yerlan Idelbayev.
Reference¶
- ..[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
- Deep Residual Learning for Image Recognition. arXiv:1512.03385
..[2] https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py
deeprobust.image.netmodels.train_model module¶
This function help to train model of different archtecture easily. Select model archtecture and training data, then output corresponding model.
-
train
(model, data, device, maxepoch, data_path='./', save_per_epoch=10, seed=100)[source]¶ train.
Parameters: - model – model(option:’CNN’, ‘ResNet18’, ‘ResNet34’, ‘ResNet50’, ‘densenet’, ‘vgg11’, ‘vgg13’, ‘vgg16’, ‘vgg19’)
- data – data(option:’MNIST’,’CIFAR10’)
- device – device(option:’cpu’, ‘cuda’)
- maxepoch – training epoch
- data_path – data path(default = ‘./’)
- save_per_epoch – save_per_epoch(default = 10)
- seed – seed
Examples
>>>import deeprobust.image.netmodels.train_model as trainmodel >>>trainmodel.train(‘CNN’, ‘MNIST’, ‘cuda’, 20)
deeprobust.image.netmodels.train_resnet module¶
deeprobust.image.netmodels.vgg module¶
This is an implementation of VGG net.
Reference¶
..[1]Simonyan, Karen, and Andrew Zisserman. “Very deep convolutional networks for large-scale image recognition.” arXiv preprint arXiv:1409.1556 (2014). ..[2]Original implementation: https://github.com/kuangliu/pytorch-cifar