# It creates two files one caffe.log.test that contains the loss and test accuracy of the test and
# another one caffe.log.loss that contains the loss computed during the training
+#get the dirname of the script
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
if [ "$#" -lt 1 ]
then
echo "Usage parselog.sh /path/to/your.log"
# For extraction of time since this line constains the start time
grep '] Solving ' $1 > aux3.txt
grep 'Testing net' $1 >> aux3.txt
-./extract_seconds.py aux3.txt aux4.txt
+$DIR/extract_seconds.py aux3.txt aux4.txt
# Generating
echo '# Iters Seconds TestAccuracy TestLoss'> $LOG.test
grep ', lr = ' $1 | awk '{print $9}' > aux2.txt
# Extracting elpased seconds
-./extract_seconds.py aux.txt aux3.txt
+$DIR/extract_seconds.py aux.txt aux3.txt
# Generating
echo '# Iters Seconds TrainingLoss LearningRate'> $LOG.train
#!/usr/bin/env python
+import inspect
import os
import random
import sys
import matplotlib.markers as mks
def get_log_parsing_script():
- return './parselog.sh'
+ dirname = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
+ return dirname + '/parselog.sh'
def get_log_file_suffix():
return '.log'
return field in x_axis_fields
def create_field_index():
- train_key = 'Training'
+ train_key = 'Train'
test_key = 'Test'
field_index = {train_key:{'Iters':0, 'Seconds':1, train_key + ' loss':2,
train_key + ' learning rate':3},
return data_file_type
def get_data_file(chart_type, path_to_log):
- return path_to_log + '.' + get_data_file_type(chart_type).lower()
+ return os.path.basename(path_to_log) + '.' + get_data_file_type(chart_type).lower()
def get_field_descriptions(chart_type):
description = get_chart_type_description(chart_type).split(