<jupyter_start><jupyter_text>Resnet34<jupyter_code>import os, sys
# Open a file
path = "/scratch/paulcalle/kidney_results/archRESNET1_results"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
print(res)
l_history_files
pd.DataFrame.from_dict(history_temp)
df_val_results_resnet1 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                     columns=["k%s_val"%i for i in np.arange(1,11,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    

    with open('/scratch/paulcalle/kidney_results/archRESNET1_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    print("ind_min_val_loss=", ind_min_val_loss)
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
        
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    
    df_val_results_resnet1.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
df_val_results_resnet1
df_val_results_resnet1.to_csv("arch_resnet34.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 summit<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/kidney_results/summit/archRESNET50_results"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                     columns=["k%s_val"%i for i in np.arange(1,11,1)])

df_epoch_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                     columns=["k%s_val"%i for i in np.arange(1,11,1)])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/kidney_results/summit/archRESNET50_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    if ind_min_val_loss > max_epoch:
        max_epoch = ind_min_val_loss
    
    df_epoch_results_resnet50.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
#     plt.plot( history_temp['val_loss'])
    
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
    
print("max epoch = ",max_epoch)
history_temp
df_epoch_results_resnet50.to_csv("arch_resnet50_epoch.csv")
df_epoch_results_resnet50
df_val_results_resnet50
df_val_results_resnet50.to_csv("arch_resnet50_summit.csv")<jupyter_output><empty_output><jupyter_text>Time<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/kidney_results/summit/archRESNET50_results"
dirs = os.listdir( path )
dirs
import re

l_time_files = []

r = re.compile('time_total')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_time_files.append(item)
l_time_files
df_val_time_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                     columns=["k%s_val"%i for i in np.arange(1,11,1)])

for item in l_time_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
       
    time_temp = np.load('/scratch/paulcalle/kidney_results/summit/archRESNET50_results/' + item,)
    
    print(time_temp)
    
    df_val_time_resnet50.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = time_temp
df_val_time_resnet50
df_val_time_resnet50.to_csv("arch_resnet50_time_validation.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 outer summit<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/kidney_results/summit/archRESNET50_outer_results"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                                          columns = ["accuracy"])

max_epoch = 0 

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    with open('/scratch/paulcalle/kidney_results/summit/archRESNET50_outer_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    
   
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][-1]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50.loc["K%s_outer"%k_outer] = val_acc
    
print("max epoch = ",max_epoch)
df_val_results_resnet50
df_val_results_resnet50.to_csv("arch_resnet50_outer.csv")<jupyter_output><empty_output><jupyter_text>Time<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/kidney_results/summit/archRESNET50_outer_results_w_model"
dirs = os.listdir( path )
dirs
import re

l_time_files = []

r = re.compile('time_total')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_time_files.append(item)
l_time_files
df_val_time_resnet50 = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                     columns=["time"])

for item in l_time_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)
     
    time_temp = np.load('/scratch/paulcalle/kidney_results/summit/archRESNET50_outer_results_w_model/' + item,)
    
    print(time_temp)
    
    df_val_time_resnet50.loc["K%s_outer"%k_outer, "time"] = time_temp
df_val_time_resnet50
df_val_time_resnet50.to_csv("arch_resnet50_time_testing.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 TF summit<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/kidney_results/summit/archRESNET50_tl_results"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history_a')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50_tf = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                     columns=["k%s_val"%i for i in np.arange(1,11,1)])

df_epoch_results_resnet50_tf = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                     columns=["k%s_val"%i for i in np.arange(1,11,1)])

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/kidney_results/summit/archRESNET50_tl_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
#     if history_temp['val_loss'][3] < 100:
#         plt.plot( history_temp['val_loss'])
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    print(history_temp['val_loss'])
    print("ind_min_val_loss = ", ind_min_val_loss)
    
    df_epoch_results_resnet50_tf.loc["K%s_outer"%k_outer, "k%s_val"%k_val] = ind_min_val_loss
    
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_resnet50_tf.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
df_epoch_results_resnet50_tf
df_epoch_results_resnet50_tf.to_csv("arch_resnet50_tf_epoch_a.csv")
df_epoch_results_resnet50_tf
# df_epoch_results_resnet50_tf.to_csv("arch_resnet50_tf_epoch_b.csv")
df_val_results_resnet50_tf
df_val_results_resnet50_tf.to_csv("arch_resnet50_tf.csv")<jupyter_output><empty_output><jupyter_text>Resnet 50 TF outer summit<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/kidney_results/summit/archRESNET50_tl_outer_results"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history_b')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
l_history_files
df_val_results_resnet50_tf = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                                          columns = ["accuracy"])

# df_val_results_resnet50_tf = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
#                      columns=["k%s_val"%i for i in np.arange(1,11,1)])


for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

   
    with open('/scratch/paulcalle/kidney_results/summit/archRESNET50_tl_outer_results/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
   
    val_acc = history_temp['val_accuracy'][-1]
    print("val_acc = ", val_acc)
    
    
    df_val_results_resnet50_tf.loc["K%s_outer"%k_outer] = val_acc
history_temp
history_temp
 df_val_results_resnet50_tf
history_temp['val_loss'][-1]
 df_val_results_resnet50_tf.to_csv("arch_resnet50_tf_outer_b.csv")<jupyter_output><empty_output><jupyter_text>Time a<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/kidney_results/summit/archRESNET50_tf_outer_results_w_model"
dirs = os.listdir( path )
dirs
import re

l_time_files = []

r = re.compile('time_a')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_time_files.append(item)
l_time_files
df_val_time_resnet50tf = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                     columns=["time"])

for item in l_time_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)
     
    time_temp = np.load('/scratch/paulcalle/kidney_results/summit/archRESNET50_tf_outer_results_w_model/' + item,)
    
    print(time_temp)
    
    df_val_time_resnet50tf.loc["K%s_outer"%k_outer, "time"] = time_temp
df_val_time_resnet50tf
df_val_time_resnet50tf.to_csv("arch_resnet50tf_time_testing.csv")<jupyter_output><empty_output><jupyter_text>Time total<jupyter_code>import re

l_time_files = []

r = re.compile('time_total')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_time_files.append(item)
l_time_files
df_val_time_resnet50tf = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                     columns=["time"])

for item in l_time_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)
     
    time_temp = np.load('/scratch/paulcalle/kidney_results/summit/archRESNET50_tf_outer_results_w_model/' + item,)
    
    print(time_temp)
    
    df_val_time_resnet50tf.loc["K%s_outer"%k_outer, "time"] = time_temp
df_val_time_resnet50tf
df_val_time_resnet50tf.to_csv("arch_resnet50tf_time_total_testing.csv")<jupyter_output><empty_output><jupyter_text>Mobilenetv2 TF Summit<jupyter_code>import pandas as pd
import numpy as np
import pickle
import os, sys
# Open a file
path = "/scratch/paulcalle/kidney_results/summit/mobilenetv2_tl_results_vC"
dirs = os.listdir( path )
dirs
import re

l_history_files = []

r = re.compile('history_b')

for item in dirs:

    res = r.search(item)
    if res != None:
        l_history_files.append(item)
df_val_results_mobilenetv2_tf = pd.DataFrame(np.nan, index=["K%s_outer"%i for i in np.arange(1,11,1)],
                     columns=["k%s_val"%i for i in np.arange(1,11,1)])

for item in l_history_files:
    print(item)
    # Get outter look
    r_outer = re.compile(r'(?<=K)[0-9]+')
    k_outer = r_outer.search(item).group(0)
    print("k_outer = ", k_outer)

    # Get inner look
    r_inner = re.compile(r'(?<=k)[0-9]+')
    k_val = r_inner.search(item).group(0)
    print("k_val = ", k_val)
    
    with open('/scratch/paulcalle/kidney_results/summit/mobilenetv2_tl_results_vC/' + item, 'rb') as handle:
        history_temp = pickle.load(handle)
    
    # Search index of validation
    ind_min_val_loss = np.argmin(history_temp['val_loss'])
    
#     plt.plot( history_temp['val_loss'])
    
    print(history_temp['val_loss'])
    print("ind_min_val_loss = ", ind_min_val_loss)
    val_acc = history_temp['val_accuracy'][ind_min_val_loss]
    print("val_acc = ", val_acc)
    
    df_val_results_mobilenetv2_tf.loc["K%s_outer"%k_outer,"k%s_val"%k_val] = val_acc
df_val_results_mobilenetv2_tf
df_val_results_mobilenetv2_tf.to_csv("arch_mobilenetv2_tf.csv")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13054135443658518, 'fraction_numerical': 0.02121997338749212, 'mean_word_length': 4.0495049504950495, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '629967', 'license': 'MIT', 'n_tokens_mistral': 5853, 'n_tokens_neox': 5729, 'n_words': 899, 'path': 'Processing_results.ipynb', 'repo_name': 'thepanlab/FOCT_kidney', 'size': '14279'}