Skip to content

Commit

Permalink
Adapted Readme files wrt new directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
pkranen committed Dec 21, 2015
1 parent 835b319 commit 1527b89
Show file tree
Hide file tree
Showing 18 changed files with 76 additions and 93 deletions.
10 changes: 5 additions & 5 deletions CNTK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -560,22 +560,22 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VGG", "VGG", "{BC0D6DFF-80C
Examples\Image\Miscellaneous\ImageNet\VGG\VGG_E.ndl = Examples\Image\Miscellaneous\ImageNet\VGG\VGG_E.ndl
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Miscellaneous", "Miscellaneous", "{CCD56F12-BA17-4753-B5EE-4995FE682995}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Other", "Other", "{CCD56F12-BA17-4753-B5EE-4995FE682995}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Simple2d", "Simple2d", "{D2A060F1-128E-42A1-A0D0-3E3E1DFBC427}"
ProjectSection(SolutionItems) = preProject
Examples\Miscellaneous\Simple2d\README.md = Examples\Miscellaneous\Simple2d\README.md
Examples\Other\Simple2d\README.md = Examples\Other\Simple2d\README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NdlExamples", "NdlExamples", "{FC573A62-6DAE-40A4-8153-520C8571A007}"
ProjectSection(SolutionItems) = preProject
Examples\Miscellaneous\NdlExamples\NDLExamples.ndl = Examples\Miscellaneous\NdlExamples\NDLExamples.ndl
Examples\Other\NdlExamples\NDLExamples.ndl = Examples\Other\NdlExamples\NDLExamples.ndl
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Config", "Config", "{1E37CE40-556D-4693-B58C-F8D4CE349BB7}"
ProjectSection(SolutionItems) = preProject
Examples\Miscellaneous\Simple2d\Config\Multigpu.config = Examples\Miscellaneous\Simple2d\Config\Multigpu.config
Examples\Miscellaneous\Simple2d\Config\Simple.config = Examples\Miscellaneous\Simple2d\Config\Simple.config
Examples\Other\Simple2d\Config\Multigpu.config = Examples\Other\Simple2d\Config\Multigpu.config
Examples\Other\Simple2d\Config\Simple.config = Examples\Other\Simple2d\Config\Simple.config
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Miscellaneous", "Miscellaneous", "{BF1A621D-528B-4B84-AAFC-EF1455FC6830}"
Expand Down
19 changes: 9 additions & 10 deletions Examples/Image/MNIST/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

## Overview

| | |
|:--------|:---|
Data: |The MNIST database (http://yann.lecun.com/exdb/mnist/) of handwritten digits.
Purpose: |This example demonstrates usage of NDL to train neural networks on MNIST dataset.
Network: |NDLNetworkBuilder, simple feed forward and convolutional networks, cross entropy with softmax.
Training: |Stochastic gradient descent both with and without momentum.
Comments: |There are two config files, details are provided below.
|Data: |The MNIST database (http://yann.lecun.com/exdb/mnist/) of handwritten digits.
|:---------|:---
|Purpose: |This example demonstrates usage of the NDL (Network Description Language) to define networks.
|Network: |NDLNetworkBuilder, simple feed forward and convolutional networks, cross entropy with softmax.
|Training: |Stochastic gradient descent both with and without momentum.
|Comments: |There are two config files, details are provided below.

## Running the example

Expand All @@ -21,12 +20,12 @@ downloaded and converted by running the following command from the 'AdditionalFi

The script will download all required files and convert them to CNTK-supported format.
The resulting files (Train-28x28.txt and Test-28x28.txt) will be stored in the 'Data' folder.
In case you don't have a Python installed, there are 2 options:
In case you don't have Python installed, there are 2 options:

1. Download and install latest version of Python 2.7 from: https://www.python.org/downloads/
Then install numpy package by following instruction from: http://www.scipy.org/install.html#individual-packages
Then install the numpy package by following instruction from: http://www.scipy.org/install.html#individual-packages

2. Alternatively install Python Anaconda distribution which contains most of the
2. Alternatively install the Python Anaconda distribution which contains most of the
popular Python packages including numpy: http://continuum.io/downloads

### Setup
Expand Down
12 changes: 0 additions & 12 deletions Examples/Image/README.md

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

## Overview

| | |
|:--------|:---|
Data |Two dimensional synthetic data
Purpose |Showcase how to train a simple CNTK network (CPU and GPU) and how to use it for scoring (decoding)
Network |SimpleNetworkBuilder, 2 hidden layers with 50 sigmoid nodes each, cross entropy with softmax
Training |Stochastic gradient descent with momentum
Comments |There are two config files: Simple.config uses a single CPU or GPU, Multigpu.config uses data-parallel SGD for training on multiple GPUs
|Data |Two dimensional synthetic data
|:--------|:---
|Purpose |Showcase how to train a simple CNTK network (CPU and GPU) and how to use it for scoring (decoding)
|Network |SimpleNetworkBuilder, 2 hidden layers with 50 sigmoid nodes each, cross entropy with softmax
|Training |Stochastic gradient descent with momentum
|Comments |There are two config files: Simple.config uses a single CPU or GPU, Multigpu.config uses data-parallel SGD for training on multiple GPUs

## Running the example

### Getting the data

The data for this example is already contained in the folder Demos/Simple2d/Data/.
The data for this example is already contained in the folder Simple2d/Data/.

### Setup

Expand All @@ -30,16 +29,16 @@ or prefix the call to the cntk executable with the corresponding folder.

### Run

Run the example from the Demos/Simple2d/Data folder using:
Run the example from the Simple2d/Data folder using:

`cntk configFile=../Config/Simple.config`

or run from any folder and specify the Data folder as the `currentDirectory`,
e.g. running from the Demos/Simple2d folder using:
e.g. running from the Simple2d folder using:

`cntk configFile=Config/Simple.config currentDirectory=Data`

The output folder will be created inside Demos/Simple2d/.
The output folder will be created inside Simple2d/.

## Details

Expand Down Expand Up @@ -71,10 +70,13 @@ SimpleDemoDataReference.png shows a plot of the training data.

## Using a trained model

The Test (e.g. Simple_Demo_Test) and the Output (e.g. Simple_Demo_Output) commands
specified in the config files use the trained model to compute labels for data specified in the SimpleDataTest.txt file.
The Test command computes prediction error, cross entropy and perplexity for the test set and outputs them to the console.
The Output command writes for each test instance the likelihood per label to a file `outputPath = $OutputDir$/SimpleOutput`.
To use the Output command either set `command=Simple_Demo_Output` in the config file or add it to the command line.
The model that is used to compute the labels in these commands is defined
in the modelPath variable at the beginning of the file `modelPath=$modelDir$/simple.dnn`.
The Test (Simple_Demo_Test) and the Output (Simple_Demo_Output) commands
specified in the config files use the trained model to compute labels for data
specified in the SimpleDataTest.txt file. The Test command computes prediction
error, cross entropy and perplexity for the test set and outputs them to the
console. The Output command writes for each test instance the likelihood per
label to a file `outputPath = $OutputDir$/SimpleOutput`.
To use the Output command either set `command=Simple_Demo_Output` in the config
file or add it to the command line. The model that is used to compute the labels
in these commands is defined in the modelPath variable at the beginning of the
file `modelPath=$modelDir$/simple.dnn`.
35 changes: 15 additions & 20 deletions Examples/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
# CNTK Demos and Example Setups
# CNTK Examples

This folder contains a few self-contained demos to get started with CNTK.
The data for the demos is contained in the corresponding Data folders.
Each demo folder has a Readme file that explains how to run it on Windows and Linux.
How to run the demos on Philly (https://phillywebportal.azurewebsites.net/index.aspx) is
explained in the Philly portal wiki (Philly is an internal GPU cluster for Microsoft production runs).
The demos cover different domains such as Speech and Text classification
and show different types of networks including FF, CNN RNN and LSTM.
This folder contains demos and examples to get started with CNTK.
The examples are structured by topic into Image, Speech, Text and Other.
The individual folders contain on the first level at least one self-contained example,
which cover different types of networks including FF, CNN, RNN and LSTM.
Further examples for for each category are provided in the corresponding Miscellaneous subfolder.
Each folder contains a Readme file that explains how to run the example on Windows and Linux.
How to run the examples on Philly (https://philly) is explained in the Philly portal wiki
(Philly is an internal GPU cluster for Microsoft production runs).

Further examples are provided in the folder 'ExampleSetups'.
A popular example is the MNIST handwritten digits classification task.
You can find this example in 'ExampleSetups/Images/MNIST'.
The examples in 'ExampleSetups' might require downloading data which in some cases is not free of charge.
See individual folders for more information.

The four examples shown in the table below provide a good introduction to CNTK.
Additional more complex examples can be found in the 'ExampleSetups' folder.
The examples shown in the table below provide a good introduction to CNTK.
Please refer to the Readme file in the corresponding folder for further details.

|Folder | Domain | Network types |
|:------------------------|:-------------------------------------------------|:----------------|
Demos/Simple2d | Synthetic 2d data | FF (CPU and GPU)
Demos/Speech | Speech data (CMU AN4) | FF and LSTM
Demos/Text | Text data (penn treebank) | RNN
ExampleSetups/Image/MNIST | Image data (MNIST handwritten digit recognition) | CNN
|Other/Simple2d | Synthetic 2d data | FF (CPU and GPU)
|Speech/AN4 | Speech data (CMU AN4) | FF and LSTM
|Image/MNIST | Image data (MNIST handwritten digit recognition) | CNN
|Text/PennTreebank | Text data (penn treebank) | RNN
25 changes: 12 additions & 13 deletions Examples/Speech/AN4/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CNTK example: Speech
# CNTK example: Speech AN4

## License

Expand All @@ -9,19 +9,18 @@ This modified version of dataset is distributed under the terms of a AN4 license

## Overview

| | |
|:--------|:---|
Data: |Speech data from the CMU Audio Database aka AN4 (http://www.speech.cs.cmu.edu/databases/an4)
Purpose: |Showcase how to train feed forward and LSTM networks for speech data
Network: |SimpleNetworkBuilder for 2-layer FF, NdlNetworkBuilder for 3-layer LSTM network
Training: |Data-parallel 1-Bit SGD with automatic mini batch rescaling (FF)
Comments: |There are two config files: FeedForward.config and LSTM-NDL.config for FF and LSTM training respectively
|Data: |Speech data from the CMU Audio Database aka AN4 (http://www.speech.cs.cmu.edu/databases/an4)
|:---------|:---|
|Purpose: |Showcase how to train feed forward and LSTM networks for speech data
|Network: |SimpleNetworkBuilder for 2-layer FF, NdlNetworkBuilder for 3-layer LSTM network
|Training: |Data-parallel 1-Bit SGD with automatic mini batch rescaling (FF)
|Comments: |There are two config files: FeedForward.config and LSTM-NDL.config for FF and LSTM training respectively

## Running the example

### Getting the data

The data for this example is already contained in the folder Demos/Text/Data/.
The data for this example is already contained in the folder AN4/Data/.

### Setup

Expand All @@ -37,16 +36,16 @@ or prefix the call to the cntk executable with the corresponding folder.

### Run

Run the example from the Demos/Speech/Data folder using:
Run the example from the Speech/Data folder using:

`cntk configFile=../Config/FeedForward.config`

or run from any folder and specify the Data folder as the `currentDirectory`,
e.g. running from the Demos/Speech folder using:
e.g. running from the Speech folder using:

`cntk configFile=Config/FeedForward.config currentDirectory=Data`

The output folder will be created inside Demos/Speech/.
The output folder will be created inside Speech/.

## Details

Expand All @@ -60,7 +59,7 @@ To run on CPU set `deviceId = -1`, to run on GPU set deviceId to "auto" or a spe

The FeedForward.config file uses the SimpleNetworkBuilder to create a 2-layer
feed forward network with sigmoid nodes and a softmax layer.
The LSTM-NDL.config file uses the NdlNetworkBuilder and refers to the lstmp-3layer_WithSelfStab.ndl file.
The LSTM-NDL.config file uses the NdlNetworkBuilder and refers to the lstmp-3layer-opt.ndl file.
In the ndl file an LSTM component is defined and used to create a 3-layer LSTM network with a softmax layer.
Both configuration only define and execute a single training task:

Expand Down
22 changes: 11 additions & 11 deletions Examples/Text/PennTreebank/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ Note: The data is not checked into the repository currently since a license is r

## Overview

| | |
|:--------|:---|
Data: |The Penn Treebank Project (https://www.cis.upenn.edu/~treebank/) annotates naturally-occuring text for linguistic structure .
Purpose: |Showcase how to train a recurrent network for text data.
Network: |SimpleNetworkBuilder for recurrent network with two hidden layers.
Training: |Stochastic gradient descent with adjusted learning rate.
Comments: |The provided configuration file performs class based RNN training.
|Data: |The Penn Treebank Project (https://www.cis.upenn.edu/~treebank/) annotates naturally-occuring text for linguistic structure .
|:---------|:---|
|Purpose: |Showcase how to train a recurrent network for text data.
|Network: |SimpleNetworkBuilder for recurrent network with two hidden layers.
|Training: |Stochastic gradient descent with adjusted learning rate.
|Comments: |The provided configuration file performs class based RNN training.

## Running the example

### Getting the data

The data for this example is already contained in the folder Demos/Text/Data/.
The data is not checked into the repository currently since a license is required for the penn treebank data.
Please visit https://www.cis.upenn.edu/~treebank/

### Setup

Expand All @@ -34,16 +34,16 @@ or prefix the call to the cntk executable with the corresponding folder.

### Run

Run the example from the Demos/Text/Data folder using:
Run the example from the Text/Data folder using:

`cntk configFile=../Config/rnn.config`

or run from any folder and specify the Data folder as the `currentDirectory`,
e.g. running from the Demos/Text folder using:
e.g. running from the Text folder using:

`cntk configFile=Config/rnn.config currentDirectory=Data`

The output folder will be created inside Demos/Text/.
The output folder will be created inside Text/.

## Details

Expand Down
8 changes: 4 additions & 4 deletions Tools/build-and-test
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fi
cd $CNTK_ROOT

if ! [[ -f $CONF_FILE ]]; then
cp Examples/Miscellaneous/Simple2d/Config/Simple.config $CONF_FILE || exit $?
cp Examples/Other/Simple2d/Config/Simple.config $CONF_FILE || exit $?

# This chmod is necessary due to restrictive Cygwin interpretation of Windows permissions.
# Cygwin interprets Windows permissions as ----rwx---, which lacks read permissions for user.
Expand Down Expand Up @@ -213,8 +213,8 @@ fi
if [[ $RUN == 1 ]]; then

cd $PREFIX_DIR
echo "============ cp Examples/Miscellaneous/Simple2d/Config/Simple.config $CONF_FILE ============"
echo "============ cd $CNTK_ROOT/Examples/Miscellaneous/Simple2d/Data ============"
echo "============ cp Examples/Other/Simple2d/Config/Simple.config $CONF_FILE ============"
echo "============ cd $CNTK_ROOT/Examples/Other/Simple2d/Data ============"

for TARGET in "${targetArray[@]}"
do
Expand Down Expand Up @@ -250,7 +250,7 @@ if [[ $RUN == 1 ]]; then
echo "============ Running $BIN_PATH configFile=$CONF_FILE for ($FLAVOR) ($TARGET) ============"
fi
echo "============ output in ($OUT_FILE) ============"
cd $CNTK_ROOT/Examples/Miscellaneous/Simple2d/Data
cd $CNTK_ROOT/Examples/Other/Simple2d/Data
rm -rf models
if [[ $OS == "Windows_NT" ]]; then
# We have to use cygpath on Windows to modify the file paths into the format readable by cntk.
Expand Down

0 comments on commit 1527b89

Please sign in to comment.