下载工程
git clone https://github.com/SpikeKing/DL-Project-Template
创建和激活虚拟环境
virtualenv venv
source venv/bin/activate
安装Python依赖库
pip install -r requirements.txt
开发流程
执行训练模型和预测样本操作。
识别MNIST库中手写数字,工程simple_mnist
训练:
python main_train.py -c configs/simple_mnist_config.json
预测:
python main_test.py -c configs/simple_mnist_config.json -m simple_m
nist.weights.10-0.24.hdf5
TensorBoard
操作步骤:
get_train_data()
和get_test_data()
,返回训练和测试数据;操作步骤:
build_model()
,创建网络结构;build_model()
;注意:plot_model()
支持绘制网络结构;
操作步骤:
train()
,fit数据,训练网络结构;注意:支持在训练中调用callbacks,额外添加模型存储、TensorBoard、FPR度量等。
操作步骤:
load_model()
,提供模型加载功能;predict()
,提供样本预测功能;定义在模型训练过程中所需的参数,JSON格式,支持:学习率、Epoch、Batch等参数。
训练:
预测: