How to train the MLP Deep Learning Model¶
Prerequisites¶
There are 2 prerequisites to training the MLP Deep Learning Model:
Install Dependencies¶
Run the following commands to install the necessary dependencies:
Install numpy:
conda install numpyInstall tensorflow:
conda install tensorflowInstall keras:
conda install -c conda-forge kerasInstall h5py:
conda install h5pyInstall protobuf:
conda install -c conda-forge protobufInstall PyTorch:
conda install -c pytorch pytorch
Train the Model¶
The following steps are to be followed in order to train the MLP model using the released demo data. For convenience, we denote APOLLO as the path of the local apollo repository, for example, /home/username/apollo
Create a folder to store offline prediction data using the command
mkdir APOLLO/data/predictionif it does not existStart dev docker using
bash docker/scripts/dev_start.shunder the apollo folderEnter dev docker using
bash docker/scripts/dev_into.shunder apollo folderIn docker, under
/apollo/, runbash apollo.sh buildto compileIn docker, under
/apollo/, copy the demo record into/apollo/data/predictionby the command:cp /apollo/docs/demo_guide/demo_3.5.record /apollo/data/prediction/In docker, under
/apollo/, run the bash script for feature extraction:bash modules/tools/prediction/mlp_train/feature_extraction.sh /apollo/data/prediction/ apollo/data/prediction/, then the feature files will be generated in the folder/apollo/data/prediction/.Exit docker, train the cruise model and junction model according to
APOLLO/modules/tools/prediction/mlp_train/cruiseMLP_train.pyandAPOLLO/modules/tools/prediction/mlp_train/junctionMLP_train.py