Dear Sir
I use the dscomplie generate mnist database file with
dscomplie mnist/train -outdir dataset -dname mnist_train28 -dims 28x28x1 -kernelsz 5x5
dscomplie mnist/testn -outdir dataset -dname mnist_test28 -dims 28x28x1 -kernelsz 5x5
Then I use the train utility to train the net.
At last I run the imfprog,
In order to check the output of imfprop, I add the lines
pMostConfBB = bbs.get_most_confident();
cout<<endl<<"class = "<<pMostConfBB->class_id<<" confidence = "<<pMostConfBB->confidence<<endl;
after the line 310 in the file fprop_thread.hpp.
But the results are very wrong. I don't know what is wrong with me. Can you please give me a help? Or please give me a correct configuration for it if I am wrong with my configuration.
Thanks in advance
Sunny
Below is my configuration
********************************************************
# paths ########################################################################
name = mnist
ebl = ${HOME}/eblearn/ # eblearn root
root = D:\work\EBLearn\eblearn-1.1\demos\mnist # mnist data root #TJ
out = = D:\work\EBLearn\data\
##########################################
run_type = detect ##train # detect fprop # TJ
##########################################
# network high level switches ##################################################
classifier_type = cf # type of classifier, cf: 2-layer, c: 1-layer
classifier_hidden = 16 # number of hidden units in 2-layer classifier
features_type = cscs # type of features
nonlin = tanh # type of non-linearity
manual_load = 0 # manually load weights for individual modules
norm = 1 # use normalization layers
pool = l2pool # subs (is another option)
# features and classifiers #####################################################
arch = ${pp},${arch_${run_type}} # run_type is set by runned tool
arch_train = ${features},${classifier}
arch_detect = ${arch_train}
arch_fprop = ${features}
arch_name = ${arch_name_${run_type}}
arch_name_fprop = ${features_name}
arch_name_train = ${features},${classifier}
features = ${features_${features_type}}
features_name = ${features_type}
classifier = ${classifier_${classifier_type}}
# energies & answers ###########################################################
trainer = trainable_module1 # the trainer module
trainable_module1_energy = l2_energy # type of energy
answer = class_answer # how to infer answers from network raw outputs
# normalization ################################################################
norm0_0 = # no normalization
norm2_0 = # no normalization
norm0_1 = wstd0 # contrast normalization
norm2_1 = wstd2 # contrast normalization
# architecture #################################################################
# features
features_cscs = ${c0},${s1},${c2},${s3}
# classifiers
classifier_c = ${c5}
classifier_cf = ${c5},${f7}
# main branch layers
c0 = conv0,addc0,${nonlin},abs0,${norm0_${norm}}
s1 = ${pool}1,addc1,${nonlin}
c2 = conv2,addc2,${nonlin},abs2,${norm2_${norm}}
s3 = ${pool}3,addc3,${nonlin}
c5 = conv5,addc5,${nonlin}
f6 = linear6,addc6,${nonlin}
f7 = linear7,addc7,${nonlin}
# main branch parameters
inputh = 28 # input's height #TJ
inputw = 28 # input's width #TJ
zpad0_dims = 5x5 # padding for this kernel size
conv0_kernel = 5x5 # convolution kernel sizes (hxw)
conv0_stride = 1x1 # convolution strides (hxw)
conv0_table = # convolution table (optional)
conv0_table_in = 1 # conv input max, used if table file not defined
conv0_table_out = 6 # features max, used if table file not defined
conv0_weights = # manual loading of weights (optional)
addc0_weights = # manual loading of weights (optional)
wstd0_kernel = ${conv0_kernel} # normalization kernel sizes (hxw)
subs1_kernel = 2x2 # subsampling kernel sizes (hxw)
subs1_stride = ${subs1_kernel} # subsampling strides (hxw)
l2pool1_kernel = 2x2 # subsampling kernel sizes (hxw)
l2pool1_stride = ${l2pool1_kernel} # subsampling strides (hxw)
addc1_weights = # manual loading of weights (optional)
conv2_kernel = 5x5 # convolution kernel sizes (hxw)
conv2_stride = 1x1 # convolution strides (hxw)
#conv2_table = ${tblroot}/table_6_16_connect_60.mat # conv table (optional)
conv2_table_in = thickness # use current thickness as max table input
conv2_table_out = 16 # TJ ${table1_max} # features max, used if table file not defined
conv2_weights = # manual loading of weights (optional)
addc2_weights = # manual loading of weights (optional)
wstd2_kernel = ${conv2_kernel} # normalization kernel sizes (hxw)
subs3_kernel = 2x2 # subsampling kernel sizes (hxw)
subs3_stride = ${subs3_kernel} # subsampling strides (hxw)
l2pool3_kernel = 2x2 # l2poolampling kernel sizes (hxw)
l2pool3_stride = ${l2pool3_kernel} # subsampling strides (hxw)
addc3_weights = # manual loading of weights (optional)
linear5_in = ${linear5_in_${net}} # linear module input features size
linear5_out = noutputs # use number of classes as max table output
linear6_in = thickness # linear module input features size
linear6_out = ${classifier_hidden}
linear7_in = thickness # use current thickness
linear7_out = noutputs # use number of classes as max table output
conv5_kernel = 5x5 # convolution kernel sizes (hxw)
conv5_stride = 1x1 # convolution strides (hxw)
conv5_table_in = thickness # use current thickness as max table input
conv5_table_out = 120 # features max, used if table file not defined
# preprocessing ################################################################
pp = ${pp_${run_type}}
pp_train = zpad0
pp_fprop = zpad0
pp_detect = zpad0
normalization_size = 7x7 # 9 #TJ
# possible preprocessings
pp_y = rgb_to_y0
pp_yuv = rgb_to_yuv0
pp_yp = rgb_to_yp0
pp_ypuv = rgb_to_ypuv0
rgb_to_ypuv0_kernel = 7x7
resizepp0_pp = rgb_to_ypuv0
resizepp0_zpad = 2x2x2x2
# training #####################################################################
classification = 1 # load datasets in classification mode, regression otherwise
train = D:\work\EBLearn\data\mnist\mnist_train28_data.mat # training data
train_labels = D:\work\EBLearn\data\mnist\mnist_train28_labels.mat # training labels
train_size = 10000 # limit number of samples
val = D:\work\EBLearn\data\mnist\mnist_test28_data.mat # validation data
val_labels = D:\work\EBLearn\data\mnist\mnist_test28_labels.mat # validation labels
val_size = 1000 # limit number of samples
#data_bias = -128 # bias applied before coeff
data_coeff = .01 # coeff applied after bias
add_features_dimension = 1 # samples are 28x28, make them 1x28x28
test_display_modulo = 0 # modulo at which to display test results
# hyper-parameters
eta = .0001 # learning rate
reg = 0 # regularization
reg_l1 = ${reg} # L1 regularization
reg_l2 = ${reg} # L2 regularization
reg_time = 0 # time (in samples) after which to start regularizing
inertia = 0.0 # gradient inertia
anneal_value = 0.0 # learning rate decay value
anneal_period = 0 # period (in samples) at which to decay learning rate
gradient_threshold = 0.0
iterations = 5 # number of training iterations
ndiaghessian = 100 # number of sample for 2nd derivatives estimation
epoch_mode = 1 # 0: fixed number 1: show all at least once
#epoch_size = 4000 # number of training samples per epoch. comment to ignore.
epoch_show_modulo = 400 # print message every n training samples
sample_probabilities = 0 # use probabilities to pick samples
hardest_focus = 1 # 0: focus on easiest samples 1: focus on hardest ones
ignore_correct = 0 # If 1, do not train on correctly classified samples
min_sample_weight = 0 # minimum probability of each sample
per_class_norm = 1 # normalize probabiliy by class (1) or globally (0)
shuffle_passes = 1 # shuffle samples between passes
balanced_training = 1 # show each class the same amount of samples or not
random_class_order = 0 # class order is randomized or not when balanced
no_training_test = 0 # do not test on training set if 1
no_testing_test = 0 # do not test on testing set if 1
max_testing = 0 # limit testing to this number of samples
save_pickings = 0 # save sample picking statistics
binary_target = 0 # use only 1 output, -1 is negative, +1 positive
test_only = 0 # if 1, just test the data and return
keep_outputs = 1 # keep all outputs in memory
training_precision = double #float
save_weights = 1 # if 0, do not save weights when training
# training display #############################################################
display = 1 # display results
show_conf = 0 # show configuration variables or not
show_train = 1 # enable/disable all training display
show_train_ninternals = 1 # number of internal examples to display
show_train_errors = 0 # show worst errors on training set
show_train_correct = 0 # show worst corrects on training set
show_val_errors = 1 # show worst errors on validation set
show_val_correct = 1 # show worst corrects on validation set
show_hsample = 5 # number of samples to show on height axis
show_wsample = 18 # number of samples to show on height axis
show_wait_user = 0 # if 1, wait for user to close windows
# detection ####################################################################
threshold = .1 # confidence detection threshold ##TJ
net_min_height = ${inputh} ##TJ
net_min_width = ${inputw} ##TJ
min_scale = 0.75 #.75 # min scale as factor of minimal network size
max_scale = 1.3 # max scale as factor of original resolution
#classes = ${ebl}/demos/mnist/mnist_classes.mat # names and # of classes
classes = D:\work\EBLearn\data\mnist\mnist_train28_classes.mat ## TJ
scaling_type = 4 # 4: no multi-scaling, just original 28x28 image
input_gain = ${data_coeff} # use same gain as in preprocessed training data
camera = directory # input images come from a directory
##############################################################
input_dir = D:\work\EBLearn\data\mnist\test28x28
#############################################################
next_on_key = n # with focus on display window, press "n" to process next
######################################
weights = D:\work\EBLearn\eblearn-1.1\bin\_net00004.mat
######################################
################################################################################
# detection display ############################################################
display_sleep = 0 # sleep in milliseconds after displaying ##TJ
#silent = 1
# preprocessing modules ###TJ
pp_y = rgb_to_y0
pp_detect = resizepp0,