https://github.com/durandtibo/wsl.resnet.torch
Torch implementation for weakly supervised learning of ResNet
https://github.com/durandtibo/wsl.resnet.torch
Last synced: 2 months ago
JSON representation
Torch implementation for weakly supervised learning of ResNet
- Host: GitHub
- URL: https://github.com/durandtibo/wsl.resnet.torch
- Owner: durandtibo
- License: mit
- Created: 2016-12-19T08:56:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-22T18:06:56.000Z (over 8 years ago)
- Last Synced: 2025-03-22T15:02:09.699Z (3 months ago)
- Language: Lua
- Size: 32.2 KB
- Stars: 9
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Weakly Supervised Learning of ResNet
This implements weakly supervised learning of residual networks.
This [Torch](http://torch.ch/) implementation is based on [fb.resnet.torch](https://github.com/facebook/fb.resnet.torch).## Download pretrained models
The `download_pretrained_models` script downloads pretrained models in `data/pretrained_models` directory.
```
th download_pretrained_models.lua
```## Packages
This implementation uses the following packages:
* torch
* nn
* cunn
* cudnn
* optim
* paths
* csvigo
* matioYou also need to install [spatial-pooling.torch](https://github.com/durandtibo/spatial-pooling.torch) package to have spatial pooling modules.
## Training
To train ResNet-101 with WELDON pooling on VOC 2007 dataset, run `main.lua` with
```
th main.lua -optim sgd -LR 1e-2 -netType resnet101-weldon -batchSize 40 -imageSize 224 -data /path_dataset/VOCdevkit/VOC2007/ -dataset voc2007-cls -loss MultiLabel -train multilabel -k 15 -nEpochs 20
```
* `LR`: initial learning rate.
* `imageSize`: size of the image.
* `batchSize`: number of images per batch
* `k`: number of regions for WELDON pooling.
* `nEpochs`: number of training epochs.To train ResNet-101 with GlobalMaxPooling on VOC 2007 dataset, run `main.lua` with
```
th main.lua -optim sgd -LR 1e-2 -netType resnet101-gmp -batchSize 40 -imageSize 224 -data /path_dataset/VOCdevkit/VOC2007/ -dataset voc2007-cls -loss MultiLabel -train multilabel -k 15 -nEpochs 20
```To train ResNet-101 with GlobalAveragePooling on VOC 2007 dataset, run `main.lua` with
```
th main.lua -optim sgd -LR 1e-2 -netType resnet101-gap -batchSize 40 -imageSize 224 -data /path_dataset/VOCdevkit/VOC2007/ -dataset voc2007-cls -loss MultiLabel -train multilabel -k 15 -nEpochs 20
```## License
MIT License