Browse Source

modify lenet&alexnet

tags/v0.2.0-alpha
wukesong 6 years ago
parent
commit
15ccc5c56e
2 changed files with 10 additions and 12 deletions
  1. +4
    -5
      example/alexnet_cifar10/README.md
  2. +6
    -7
      example/lenet_mnist/README.md

+ 4
- 5
example/alexnet_cifar10/README.md View File

@@ -25,7 +25,7 @@ This is the simple tutorial for training AlexNet in MindSpore.
python train.py --data_path cifar-10-batches-bin
```

You can get loss with each step similar to this:
You will get the loss value of each step as following:

```bash
epoch: 1 step: 1, loss is 2.2791853
@@ -36,17 +36,16 @@ epoch: 1 step: 1538, loss is 1.0221305
...
```

Then, test AlexNet according to network model
Then, evaluate AlexNet according to network model
```python
# test AlexNet, 1 epoch training accuracy is up to 51.1%; 10 epoch training accuracy is up to 81.2%
# evaluate AlexNet, 1 epoch training accuracy is up to 51.1%; 10 epoch training accuracy is up to 81.2%
python eval.py --data_path cifar-10-verify-bin --mode test --ckpt_path checkpoint_alexnet-1_1562.ckpt
```

## Note
There are some optional arguments:
Here are some optional parameters:

```bash
-h, --help show this help message and exit
--device_target {Ascend,GPU}
device where the code will be implemented (default: Ascend)
--data_path DATA_PATH


+ 6
- 7
example/lenet_mnist/README.md View File

@@ -19,8 +19,8 @@ This is the simple and basic tutorial for constructing a network in MindSpore.
│ t10k-labels.idx1-ubyte
└─train
train-images.idx3-ubyte
train-labels.idx1-ubyte
train-images.idx3-ubyte
train-labels.idx1-ubyte
```

## Running the example
@@ -30,7 +30,7 @@ This is the simple and basic tutorial for constructing a network in MindSpore.
python train.py --data_path MNIST_Data
```

You can get loss with each step similar to this:
You will get the loss value of each step as following:

```bash
epoch: 1 step: 1, loss is 2.3040335
@@ -41,17 +41,16 @@ epoch: 1 step: 1741, loss is 0.05018193
...
```

Then, test LeNet according to network model
Then, evaluate LeNet according to network model
```python
# test LeNet, after 1 epoch training, the accuracy is up to 96.5%
# evaluate LeNet, after 1 epoch training, the accuracy is up to 96.5%
python eval.py --data_path MNIST_Data --mode test --ckpt_path checkpoint_lenet-1_1875.ckpt
```

## Note
There are some optional arguments:
Here are some optional parameters:

```bash
-h, --help show this help message and exit
--device_target {Ascend,GPU,CPU}
device where the code will be implemented (default: Ascend)
--data_path DATA_PATH


Loading…
Cancel
Save