Commit 67764921 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

refactoring

parent 3519f5ec
Loading
Loading
Loading
Loading
+59 −66
Original line number Original line Diff line number Diff line
@@ -7,31 +7,17 @@ __copyright__ = "Copyright 2018, Elphel, Inc."
__license__   = "GPL-3.0+"
__license__   = "GPL-3.0+"
__email__     = "andrey@elphel.com"
__email__     = "andrey@elphel.com"



#python3 nn_ds_neibs17.py /home/eyesis/x3d_data/data_sets/conf/qcstereo_conf13.xml /home/eyesis/x3d_data/data_sets
##from PIL import Image

import os
import os
import sys
import sys
##import glob

import numpy as np
import numpy as np
##import itertools

import time
import time

##import matplotlib.pyplot as plt

import shutil
import shutil
from threading import Thread
from threading import Thread

#import imagej_tiffwriter

import qcstereo_network
import qcstereo_network
import qcstereo_losses
import qcstereo_losses
import qcstereo_functions as qsf
import qcstereo_functions as qsf


#import xml.etree.ElementTree as ET

qsf.TIME_START = time.time()
qsf.TIME_START = time.time()
qsf.TIME_LAST  = qsf.TIME_START
qsf.TIME_LAST  = qsf.TIME_START


@@ -69,11 +55,15 @@ USE_CONFIDENCE, WBORDERS_ZERO, EPOCHS_TO_RUN, FILE_UPDATE_EPOCHS = [None] * 4
LR600,LR400,LR200,LR100,LR = [None]*5
LR600,LR400,LR200,LR100,LR = [None]*5
SHUFFLE_FILES, EPOCHS_FULL_TEST, SAVE_TIFFS = [None] * 3
SHUFFLE_FILES, EPOCHS_FULL_TEST, SAVE_TIFFS = [None] * 3


TRAIN_BUFFER_GPU, TRAIN_BUFFER_CPU = [None]*2



"""
Next gets globals from the config file
"""
globals().update(parameters)
globals().update(parameters)




TRAIN_BUFFER_SIZE = TRAIN_BUFFER_GPU * TRAIN_BUFFER_CPU # in merged (quad) batches






@@ -111,15 +101,6 @@ NN_LAYOUTS = {0:[0, 0, 0, 32, 20, 16],
NN_LAYOUT1 = NN_LAYOUTS[NET_ARCH1]
NN_LAYOUT1 = NN_LAYOUTS[NET_ARCH1]
NN_LAYOUT2 = NN_LAYOUTS[NET_ARCH2]
NN_LAYOUT2 = NN_LAYOUTS[NET_ARCH2]
USE_PARTIALS =      not PARTIALS_WEIGHTS is None # False - just a single Siamese net, True - partial outputs that use concentric squares of the first level subnets
USE_PARTIALS =      not PARTIALS_WEIGHTS is None # False - just a single Siamese net, True - partial outputs that use concentric squares of the first level subnets
#http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
#reading to memory (testing)
train_next = [{'file':0, 'slot':0, 'files':0, 'slots':0},
              {'file':0, 'slot':0, 'files':0, 'slots':0}]

if TWO_TRAINS:
    train_next +=  [{'file':0, 'slot':0, 'files':0, 'slots':0},
                    {'file':0, 'slot':0, 'files':0, 'slots':0}]

##############################################################################
##############################################################################
cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1)
cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1)
center_tile_index = 2 * CLUSTER_RADIUS * (CLUSTER_RADIUS + 1)
center_tile_index = 2 * CLUSTER_RADIUS * (CLUSTER_RADIUS + 1)
@@ -144,21 +125,24 @@ image_data = qsf.initImageData(
                files =          files,
                files =          files,
                max_imgs =       MAX_IMGS_IN_MEM,
                max_imgs =       MAX_IMGS_IN_MEM,
                cluster_radius = CLUSTER_RADIUS,
                cluster_radius = CLUSTER_RADIUS,
                tile_layers =    TILE_LAYERS,
                tile_side =      TILE_SIDE,
                width =          IMG_WIDTH,
                width =          IMG_WIDTH,
                replace_nans =   True)
                replace_nans =   True)
    
    
#    return train_next, dataset_train_all, datasets_test
corr2d_len, target_disparity_len, _ = qsf.get_lengths(CLUSTER_RADIUS, TILE_LAYERS, TILE_SIDE)
 
 

train_next, dataset_train, datasets_test= qsf.initTrainTestData(
datasets_train, datasets_test, num_train_sets= qsf.initTrainTestData(
        files = files,
        files = files,
        cluster_radius =      CLUSTER_RADIUS,
        cluster_radius =      CLUSTER_RADIUS,
    max_files_per_group = MAX_FILES_PER_GROUP, # shuffling buffer for files
        buffer_size =         TRAIN_BUFFER_SIZE * BATCH_SIZE) # number of clusters per train
    two_trains =          TWO_TRAINS,
##    return corr2d_len, target_disparity_len, train_next, dataset_train_merged, datasets_test
    train_next =          train_next)   

    
    
corr2d_train_placeholder =           tf.placeholder(datasets_train[0]['corr2d'].dtype,           (None,FEATURES_PER_TILE * cluster_size)) # corr2d_train.shape)
corr2d_train_placeholder =           tf.placeholder(dataset_train.dtype, (None,FEATURES_PER_TILE * cluster_size)) # corr2d_train.shape)
target_disparity_train_placeholder = tf.placeholder(datasets_train[0]['target_disparity'].dtype, (None,1 *   cluster_size))  #target_disparity_train.shape)
target_disparity_train_placeholder = tf.placeholder(dataset_train.dtype, (None,1 *   cluster_size))  #target_disparity_train.shape)
gt_ds_train_placeholder =            tf.placeholder(datasets_train[0]['gt_ds'].dtype,            (None,2 *   cluster_size)) #gt_ds_train.shape)
gt_ds_train_placeholder =            tf.placeholder(dataset_train.dtype, (None,2 *   cluster_size)) #gt_ds_train.shape)


dataset_tt = tf.data.Dataset.from_tensor_slices({
dataset_tt = tf.data.Dataset.from_tensor_slices({
    "corr2d":           corr2d_train_placeholder,
    "corr2d":           corr2d_train_placeholder,
@@ -169,9 +153,13 @@ tf_batch_weights = tf.placeholder(shape=(None,), dtype=tf.float32, name = "batch
feed_batch_weights =   np.array(BATCH_WEIGHTS*(BATCH_SIZE//len(BATCH_WEIGHTS)), dtype=np.float32)
feed_batch_weights =   np.array(BATCH_WEIGHTS*(BATCH_SIZE//len(BATCH_WEIGHTS)), dtype=np.float32)
feed_batch_weight_1 =  np.array([1.0], dtype=np.float32) 
feed_batch_weight_1 =  np.array([1.0], dtype=np.float32) 


dataset_train_size = len(datasets_train[0]['corr2d'])
##dataset_train_size = len(datasets_train[0]['corr2d'])
dataset_train_size //= BATCH_SIZE
##dataset_train_size //= BATCH_SIZE
dataset_test_size = len(datasets_test[0]['corr2d'])

#dataset_train_size = TRAIN_BUFFER_GPU * num_train_subs # TRAIN_BUFFER_SIZE

#dataset_test_size = len(datasets_test[0]['corr2d'])
dataset_test_size = len(datasets_test[0])
dataset_test_size //= BATCH_SIZE
dataset_test_size //= BATCH_SIZE
#dataset_img_size = len(datasets_img[0]['corr2d'])
#dataset_img_size = len(datasets_img[0]['corr2d'])
dataset_img_size = len(image_data[0]['corr2d'])
dataset_img_size = len(image_data[0]['corr2d'])
@@ -351,7 +339,7 @@ lr= tf.placeholder(tf.float32)
G_opt=             tf.train.AdamOptimizer(learning_rate=lr).minimize(GW_loss)
G_opt=             tf.train.AdamOptimizer(learning_rate=lr).minimize(GW_loss)




ROOT_PATH  = './attic/nn_ds_neibs16_graph'+SUFFIX+"/"
ROOT_PATH  = './attic/nn_ds_neibs17_graph'+SUFFIX+"/"
TRAIN_PATH =  ROOT_PATH + 'train'
TRAIN_PATH =  ROOT_PATH + 'train'
TEST_PATH  =  ROOT_PATH + 'test'
TEST_PATH  =  ROOT_PATH + 'test'
TEST_PATH1  = ROOT_PATH + 'test1'
TEST_PATH1  = ROOT_PATH + 'test1'
@@ -364,6 +352,9 @@ shutil.rmtree(TEST_PATH1, ignore_errors=True)
WIDTH=324
WIDTH=324
HEIGHT=242
HEIGHT=242


num_train_subs = len(train_next) # number of (different type) merged training sets    
dataset_train_size = TRAIN_BUFFER_GPU * num_train_subs # TRAIN_BUFFER_SIZE

with tf.Session()  as sess:
with tf.Session()  as sess:
    
    
    sess.run(tf.global_variables_initializer())
    sess.run(tf.global_variables_initializer())
@@ -415,10 +406,9 @@ with tf.Session() as sess:
    img_gain_test0 =  1.0
    img_gain_test0 =  1.0
    img_gain_test9 =  1.0
    img_gain_test9 =  1.0
    
    
    num_train_variants = len(datasets_train)
    thr=None
    thr=None
    thr_result = None
    thr_result = None
    trains_to_update = [train_next[n_train]['files'] > train_next[n_train]['slots'] for n_train in range(len(train_next))]
    trains_to_update = [train_next[n_train]['more_files'] for n_train in range(len(train_next))]
    for epoch in range (EPOCHS_TO_RUN):
    for epoch in range (EPOCHS_TO_RUN):
        """
        """
        update files after each epoch, all 4.
        update files after each epoch, all 4.
@@ -436,23 +426,19 @@ with tf.Session() as sess:
                qsf.print_time("Inserting new data", end=" ")
                qsf.print_time("Inserting new data", end=" ")
                for n_train in range(len(trains_to_update)):
                for n_train in range(len(trains_to_update)):
                    if trains_to_update[n_train]:
                    if trains_to_update[n_train]:
#                        print("n_train= %d, len(thr_result)=%d"%(n_train,len(thr_result)))
                        qsf.add_file_to_dataset(dataset = dataset_train,
                        qsf.replaceNextDataset(datasets_train,
                                                new_dataset = thr_result[n_train],
                                           thr_result[n_train],
                                                train_next = train_next[n_train])
                                           train_next= train_next[n_train],
                                           nset=n_train,
                                           period=len(train_next))
                        qsf._nextFileSlot(train_next[n_train])
                qsf.print_time("Done")
                qsf.print_time("Done")
            thr_result = []
            thr_result = []
            fpaths = []
            fpaths = []
            for n_train in range(len(train_next)):
            for n_train in range(len(trains_to_update)):
                if train_next[n_train]['files'] > train_next[n_train]['slots']:
                if trains_to_update[n_train]:
                    fpaths.append(files['train'][n_train][train_next[n_train]['file']])
                    fpaths.append(files['train'][n_train][train_next[n_train]['file']])
                    qsf.print_time("Will read in background: "+fpaths[-1])
                    qsf.print_time("Will read in background: "+fpaths[-1])
            thr = Thread(target=qsf.getMoreFiles, args=(fpaths,thr_result, CLUSTER_RADIUS, HOR_FLIP, TILE_LAYERS, TILE_SIDE))            
            thr = Thread(target=qsf.getMoreFiles, args=(fpaths,thr_result, CLUSTER_RADIUS, HOR_FLIP, TILE_LAYERS, TILE_SIDE))            
            thr.start()        
            thr.start()        
        file_index = epoch  % num_train_variants
        train_buf_index = epoch %   TRAIN_BUFFER_CPU # GPU memory from CPU memory (now 4)
        if   epoch >=600:
        if   epoch >=600:
            learning_rate = LR600
            learning_rate = LR600
        elif epoch >=400:
        elif epoch >=400:
@@ -463,20 +449,20 @@ with tf.Session() as sess:
            learning_rate = LR100
            learning_rate = LR100
        else:
        else:
            learning_rate = LR
            learning_rate = LR
#        print ("sr1",file=sys.stderr,end=" ")
        if (train_buf_index == 0) and SHUFFLE_FILES:
        if (file_index == 0) and SHUFFLE_FILES:
            num_train_sets # num_sets = len(datasets_train_all)
            qsf.print_time("Shuffling how datasets datasets_train_lvar and datasets_train_hvar are zipped together", end="")
            qsf.print_time("Shuffling how datasets datasets_train_lvar and datasets_train_hvar are zipped together", end="")
            for i in range(num_train_sets):
            qsf.shuffle_in_place(
                qsf.shuffle_in_place (datasets_train, i, num_train_sets)
                dataset_data = dataset_train, #alternating clusters from 4 sources.each cluster has all needed data (concatenated)
            qsf.print_time("  Done")
                period = num_train_subs)
            qsf.print_time("Shuffling tile chunks ", end="")
            qsf.shuffle_chunks_in_place (datasets_train, 1)
            qsf.print_time("  Done")
            qsf.print_time("  Done")
        sti = train_buf_index *  dataset_train_size * BATCH_SIZE #      TRAIN_BUFFER_GPU * num_train_subs
        eti = sti+   dataset_train_size * BATCH_SIZE#    (train_buf_index +1) *  TRAIN_BUFFER_GPU * num_train_subs
         
        sess.run(iterator_tt.initializer, feed_dict={corr2d_train_placeholder:           dataset_train[sti:eti,:corr2d_len], 
                                                     target_disparity_train_placeholder: dataset_train[sti:eti,corr2d_len:corr2d_len+target_disparity_len],
                                                     gt_ds_train_placeholder:            dataset_train[sti:eti,corr2d_len+target_disparity_len:] })
        
        
        
        sess.run(iterator_tt.initializer, feed_dict={corr2d_train_placeholder:           datasets_train[file_index]['corr2d'],
                                                     target_disparity_train_placeholder: datasets_train[file_index]['target_disparity'],
                                                     gt_ds_train_placeholder:            datasets_train[file_index]['gt_ds']})
        for i in range(dataset_train_size):
        for i in range(dataset_train_size):
            try:
            try:
#                train_summary,_, GW_loss_trained,  G_loss_trained,  W_loss_trained,  output, disp_slice, d_gt_slice, out_diff, out_diff2, w_norm, out_wdiff2, out_cost1, gt_variance  = sess.run(
#                train_summary,_, GW_loss_trained,  G_loss_trained,  W_loss_trained,  output, disp_slice, d_gt_slice, out_diff, out_diff2, w_norm, out_wdiff2, out_cost1, gt_variance  = sess.run(
@@ -511,7 +497,6 @@ with tf.Session() as sess:
                               tf_img_test9:     img_gain_test9}) # previous value of *_avg #Fetch argument 0.0 has invalid type <class 'float'>, must be a string or Tensor. (Can not convert a float into a Tensor or Operation.)
                               tf_img_test9:     img_gain_test9}) # previous value of *_avg #Fetch argument 0.0 has invalid type <class 'float'>, must be a string or Tensor. (Can not convert a float into a Tensor or Operation.)
                
                
                loss_gw_train_hist[i] = GW_loss_trained
                loss_gw_train_hist[i] = GW_loss_trained
#                loss_g_train_hist[i] =  G_loss_trained
                for nn, gl  in enumerate(G_losses_trained):
                for nn, gl  in enumerate(G_losses_trained):
                    loss_g_train_hists[nn][i] =  gl
                    loss_g_train_hists[nn][i] =  gl
                loss_s_train_hist[i] =  S_loss_trained
                loss_s_train_hist[i] =  S_loss_trained
@@ -519,8 +504,9 @@ with tf.Session() as sess:
                loss2_train_hist[i] = out_cost1
                loss2_train_hist[i] = out_cost1
                gtvar_train_hist[i] = gt_variance
                gtvar_train_hist[i] = gt_variance
            except tf.errors.OutOfRangeError:
            except tf.errors.OutOfRangeError:
                print("train done at step %d"%(i))
                print("****** NO MORE DATA! train done at step %d"%(i))
                break
                break
#            print ("==== i=%d, GW_loss_trained=%f  loss_gw_train_hist[%d]=%f ===="%(i,GW_loss_trained,i,loss_gw_train_hist[i]))


        train_gw_avg =      np.average(loss_gw_train_hist).astype(np.float32)     
        train_gw_avg =      np.average(loss_gw_train_hist).astype(np.float32)     
        train_g_avg =       np.average(loss_g_train_hist).astype(np.float32) 
        train_g_avg =       np.average(loss_g_train_hist).astype(np.float32) 
@@ -536,9 +522,10 @@ with tf.Session() as sess:
        tst_avg =        [0.0]*len(datasets_test)
        tst_avg =        [0.0]*len(datasets_test)
        tst2_avg =       [0.0]*len(datasets_test)
        tst2_avg =       [0.0]*len(datasets_test)
        for ntest,dataset_test in enumerate(datasets_test):
        for ntest,dataset_test in enumerate(datasets_test):
            sess.run(iterator_tt.initializer, feed_dict={corr2d_train_placeholder:      dataset_test['corr2d'],
            sess.run(iterator_tt.initializer, feed_dict={corr2d_train_placeholder:      dataset_test[:, :corr2d_len],  #['corr2d'],
                                                    target_disparity_train_placeholder: dataset_test['target_disparity'],
                                                    target_disparity_train_placeholder: dataset_test[:, corr2d_len:corr2d_len+target_disparity_len], # ['target_disparity'],
                                                    gt_ds_train_placeholder:            dataset_test['gt_ds']})
                                                    gt_ds_train_placeholder:            dataset_test[:, corr2d_len+target_disparity_len:] }) # ['gt_ds']})
            
            for i in range(dataset_test_size):
            for i in range(dataset_test_size):
                try:
                try:
                    test_summaries[ntest], GW_loss_tested, G_losses_tested, S_loss_tested, W_loss_tested, output, disp_slice, d_gt_slice, out_diff, out_diff2, w_norm, out_wdiff2, out_cost1, gt_variance = sess.run(
                    test_summaries[ntest], GW_loss_tested, G_losses_tested, S_loss_tested, W_loss_tested, output, disp_slice, d_gt_slice, out_diff, out_diff2, w_norm, out_wdiff2, out_cost1, gt_variance = sess.run(
@@ -597,8 +584,12 @@ with tf.Session() as sess:
        test_writer.add_summary(test_summaries[0], epoch)
        test_writer.add_summary(test_summaries[0], epoch)
        test_writer1.add_summary(test_summaries[1], epoch)
        test_writer1.add_summary(test_summaries[1], epoch)
        
        
        qsf.print_time("%d:%d -> %f %f %f (%f %f %f) dbg:%f %f"%(epoch,i,train_gw_avg, tst_avg[0], tst_avg[1], train2_avg, tst2_avg[0], tst2_avg[1], gtvar_train_avg, gtvar_test_avg))
        qsf.print_time("==== %d:%d -> %f %f %f (%f %f %f) dbg:%f %f ===="%(epoch,i,train_gw_avg, tst_avg[0], tst_avg[1], train2_avg, tst2_avg[0], tst2_avg[1], gtvar_train_avg, gtvar_test_avg))
        if (((epoch + 1) == EPOCHS_TO_RUN) or (((epoch + 1) % EPOCHS_FULL_TEST) == 0)) and (len(image_data) > 0) :
        if (((epoch + 1) == EPOCHS_TO_RUN) or (((epoch + 1) % EPOCHS_FULL_TEST) == 0)) and (len(image_data) > 0) :
            if (epoch + 1) == EPOCHS_TO_RUN: # last
                print("Last epoch, removing train/test datasets to reduce memory footprint")
                del(dataset_train)
                del(dataset_test)             
            last_epoch = (epoch + 1) == EPOCHS_TO_RUN
            last_epoch = (epoch + 1) == EPOCHS_TO_RUN
            ind_img = [0]
            ind_img = [0]
            if last_epoch:
            if last_epoch:
@@ -622,6 +613,8 @@ with tf.Session() as sess:
                    files =          files,
                    files =          files,
                    indx =           ntest,
                    indx =           ntest,
                    cluster_radius = CLUSTER_RADIUS,
                    cluster_radius = CLUSTER_RADIUS,
                    tile_layers =    TILE_LAYERS,
                    tile_side =      TILE_SIDE,
                    width =          IMG_WIDTH,
                    width =          IMG_WIDTH,
                    replace_nans =   True)
                    replace_nans =   True)


+17 −4
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
<properties>
<properties>
    <parameters>
    <parameters>
        <EPOCHS_TO_RUN>        650 </EPOCHS_TO_RUN> <!-- 752# 3000#0 #0 -->
        <EPOCHS_TO_RUN>        650 </EPOCHS_TO_RUN> <!-- 752# 3000#0 #0 -->
        <NET_ARCH1>              0 </NET_ARCH1> <!--1-st stage network  -->
        <NET_ARCH1>              1 </NET_ARCH1> <!--1-st stage network  -->
        <NET_ARCH2>              9 </NET_ARCH2> <!-- 2-nd stage network -->
        <NET_ARCH2>              9 </NET_ARCH2> <!-- 2-nd stage network -->
        <SYM8_SUB>           False </SYM8_SUB>          <!-- enforce inputs from 2d correlation have symmetrical ones (groups of 8) -->
        <SYM8_SUB>           False </SYM8_SUB>          <!-- enforce inputs from 2d correlation have symmetrical ones (groups of 8) -->
        <SPREAD_CONVERGENCE> False </SPREAD_CONVERGENCE><!-- Input target disparity to all nodes of the 1-st stage -->
        <SPREAD_CONVERGENCE> False </SPREAD_CONVERGENCE><!-- Input target disparity to all nodes of the 1-st stage -->
@@ -22,7 +22,7 @@
        <ONLY_TILE>           None </ONLY_TILE>           <!--  (remove all but center tile data), put None here for normal operation) -->
        <ONLY_TILE>           None </ONLY_TILE>           <!--  (remove all but center tile data), put None here for normal operation) -->
        <CLUSTER_RADIUS>         2 </CLUSTER_RADIUS>      <!--  1 # 1 - 3x3, 2 - 5x5 tiles -->
        <CLUSTER_RADIUS>         2 </CLUSTER_RADIUS>      <!--  1 # 1 - 3x3, 2 - 5x5 tiles -->
        <SHUFFLE_FILES>       True </SHUFFLE_FILES>
        <SHUFFLE_FILES>       True </SHUFFLE_FILES>
        <WLOSS_LAMBDA>         3.0 </WLOSS_LAMBDA>        <!-- fraction of the W_loss (input layers weight non-uniformity) added to G_loss -->
        <WLOSS_LAMBDA>         0.1 </WLOSS_LAMBDA>        <!-- fraction of the W_loss (input layers weight non-uniformity) added to G_loss -->
        <SLOSS_LAMBDA>         0.1 </SLOSS_LAMBDA>        <!-- weight of loss for smooth fg/bg transitions -->
        <SLOSS_LAMBDA>         0.1 </SLOSS_LAMBDA>        <!-- weight of loss for smooth fg/bg transitions -->
        <SLOSS_CLIP>           0.2 </SLOSS_CLIP>          <!-- limit punishment for cutting corners (disparity pix) -->
        <SLOSS_CLIP>           0.2 </SLOSS_CLIP>          <!-- limit punishment for cutting corners (disparity pix) -->
        <WBORDERS_ZERO>       True </WBORDERS_ZERO>       <!-- Border conditions for first layer weights: False - free, True - tied to 0 -->
        <WBORDERS_ZERO>       True </WBORDERS_ZERO>       <!-- Border conditions for first layer weights: False - free, True - tied to 0 -->
@@ -35,7 +35,20 @@
        <BATCH_WEIGHTS> [0.9, 1.0, 0.9, 1.0]</BATCH_WEIGHTS> <!-- lvar, hvar, lvar1, hvar1 (increase importance of non-flat clusters -->
        <BATCH_WEIGHTS> [0.9, 1.0, 0.9, 1.0]</BATCH_WEIGHTS> <!-- lvar, hvar, lvar1, hvar1 (increase importance of non-flat clusters -->
        <DISP_DIFF_CAP>       0.3  </DISP_DIFF_CAP><!-- cap disparity difference (do not increase loss above)-->
        <DISP_DIFF_CAP>       0.3  </DISP_DIFF_CAP><!-- cap disparity difference (do not increase loss above)-->
        <DISP_DIFF_SLOPE>     0.03 </DISP_DIFF_SLOPE><!-- allow squared error to grow above DISP_DIFF_CAP -->
        <DISP_DIFF_SLOPE>     0.03 </DISP_DIFF_SLOPE><!-- allow squared error to grow above DISP_DIFF_CAP -->
        <TRAIN_BUFFER_GPU>      79 </TRAIN_BUFFER_GPU> <!-- in batches merged (now quad)  batches-->
        <TRAIN_BUFFER_CPU>       4 </TRAIN_BUFFER_CPU> <!-- in TRAIN_BUFFER_GPU-s -->
        
    </parameters>
    </parameters>
    <dbg_parameters>
        <disparity_ranges>
            [[[0.0, 0.6,[140,230,135,60]],                                "Overlook"],
             [[0.0, 1.0,[120,180,125,80]],[2.0, 4.0,   [50,130,125, 70]], "State Street1"],            
             [[0.0, 1.0,[130,210,135,95]],[0.5, 2.5,   [50,150,150, 75]], "State Street2"],
             [                            [1.0, 2.5,   [90,170, 50,  0]], "B737 near"],
             [                            [0.75, 1.5, [125,150, 90, 70]], "B737 midrange"],
             [                            [0.4,  0.8, [135,150,102,112]], "B737 far"]]
        </disparity_ranges>
    </dbg_parameters>
    <directories>
    <directories>
        <train_lvar>
        <train_lvar>
            "tf_data_5x5_main_1"
            "tf_data_5x5_main_1"
@@ -211,8 +224,8 @@
        </test_hvar>
        </test_hvar>
        
        
        <images>
        <images>
            ["1527256858_150165-v01", <!-- State Street -->
            ["1527257933_150165-v04", <!--  overlook -->
             "1527257933_150165-v04", <!--  overlook -->
             "1527256858_150165-v01", <!--  State Street -->
             "1527256816_150165-v02", <!--  State Street -->
             "1527256816_150165-v02", <!--  State Street -->
             "1527182802_096892-v02", <!--  plane near plane -->
             "1527182802_096892-v02", <!--  plane near plane -->
             "1527182805_096892-v02", <!--  plane midrange used up to -49 plane -->
             "1527182805_096892-v02", <!--  plane midrange used up to -49 plane -->