Skip to content

Commit

Permalink
Fix Instances name
Browse files Browse the repository at this point in the history
  • Loading branch information
dingguanglei committed Dec 22, 2019
1 parent a05d679 commit b1e52e1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ for a quick test. Assuming that you get a new directory example. run
this code in ipython cmd.(Create a main.py file is also acceptable.)

``` {.sourceCode .python}
from jdit.trainer.instances.fashingClassification import start_fashingClassTrainer
start_fashingClassTrainer()
from jdit.trainer.instances.fashionClassification import start_fashionClassTrainer
if __name__ == '__main__':
start_fashionClassTrainer()
```
The following is the accomplishment of ``start_fashingClassTrainer()``
The following is the accomplishment of ``start_fashionClassTrainer()``

``` {.sourceCode .python}
# coding=utf-8
Expand Down Expand Up @@ -104,9 +105,9 @@ class SimpleModel(nn.Module):
return out
class FashingClassTrainer(ClassificationTrainer):
class FashionClassTrainer(ClassificationTrainer):
def __init__(self, logdir, nepochs, gpu_ids, net, opt, datasets, num_class):
super(FashingClassTrainer, self).__init__(logdir, nepochs, gpu_ids, net, opt, datasets, num_class)
super(FashionClassTrainer, self).__init__(logdir, nepochs, gpu_ids, net, opt, datasets, num_class)
data, label = self.datasets.samples_train
self.watcher.embedding(data, data, label, 1)
Expand All @@ -127,7 +128,7 @@ class FashingClassTrainer(ClassificationTrainer):
return var_dic
def start_fashingClassTrainer(gpus=(), nepochs=10, run_type="train"):
def start_fashionClassTrainer(gpus=(), nepochs=10, run_type="train"):
"""" An example of fashing-mnist classification
"""
Expand Down Expand Up @@ -156,14 +157,14 @@ def start_fashingClassTrainer(gpus=(), nepochs=10, run_type="train"):
print('===> Training')
print("using `tensorboard --logdir=log` to see learning curves and net structure."
"training and valid_epoch data, configures info and checkpoint were save in `log` directory.")
Trainer = FashingClassTrainer("log/fashion_classify", nepochs, gpus, net, opt, mnist, num_class)
Trainer = FashionClassTrainer("log/fashion_classify", nepochs, gpus, net, opt, mnist, num_class)
if run_type == "train":
Trainer.train()
elif run_type == "debug":
Trainer.debug()
if __name__ == '__main__':
start_fashingClassTrainer()
start_fashionClassTrainer()
```

Expand Down

0 comments on commit b1e52e1

Please sign in to comment.