tingpan

生命不息,折腾不止!
  首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

学习曲线可视化

Posted on 2018-07-23 22:59  tingpan  阅读(313)  评论(0编辑  收藏  举报

一、ubuntu中数据训练

1、数据下载

./data/cifar10/get_cifar10.sh

2、格式转换

./examples/cifar10/create_cifar10.sh

3、cifar10_quick_solver.prototxt修改为cpu模式,cifar10_quick_solver_lr1.prototxt改为cpu模式

4、运行

./examples/cifar10/train_quick.sh >& cifar10.log &

5、将train及test的loss保存

cat cifar10.log | grep "Train net output" | awk '{print $11}' >& cifar10_train.log
cat cifar10.log | grep "Test net output #1" | awk '{print $11}' >& cifar10_test.log

二、windows下可视化

6、将cifar10_train.log、cifar10_test.log拷贝到caffe/matlab目录下,

7、cifar10_show_loss_curve.m

clear;
clc;
close all;
train_interval = 100;
test_interval = 500;
 
train_loss = textread('cifar10_train.log', '%f');
n = 1:length(train_loss);
idx_train = (n-1)*train_interval;
test_loss = textread('cifar10_test.log', '%f');
m = 1:length(test_loss);
idx_test = (m-1)*test_interval;
figure; plot(idx_train, train_loss);
hold on;
plot(idx_test, test_loss);
 
grid on;
legend('Train Loss', 'Test Loss');
xlabel('iterations');
ylabel('loss');
title('Train & Test Loss Curve');

Image

三、用处

83432880188DE9D1B91957C4A68DAB32