<jupyter_start><jupyter_text>exp1. Find hyper parameter w/o compound scaling<jupyter_code>import os
import sys
import argparse

import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

from result_utils import read_config, result_data, unique_average, visualize

CONFIG_FNAME = 'exp1'
configs = read_config(CONFIG_FNAME)

RESULT_ROOT_DIR = '../results/' + CONFIG_FNAME
result_path = RESULT_ROOT_DIR + '/' + 'test_results.txt'
results = []
with open(result_path, 'r') as f:
    for line in f:
        x = line.strip().split(',')
        acc = x[1]
        results.append(acc)
results = np.array(results, dtype=float)

N = len(configs)
print('# of experiments: %d'%N)
best_idx = np.argmax(results)
print(configs[best_idx])
print(results[best_idx])<jupyter_output>OrderedDict([('case_num', 112), ('dataset', 'exp_freq'), ('normalization', True), ('batch_size', 32), ('max_epoch', 60), ('optimizer', 'adam'), ('learning_rate', 0.001), ('lr_step', 30), ('lr_decay', 0.1), ('l2_decay', 1e-06), ('use_tensorboard', False), ('model_name', 'cnn1d_adaptive'), ('alpha', 1.0), ('beta', 1.0), ('gamma', 1.0), ('phi', 1.0), ('loss_fn', 'cross_entropy'), ('kernel_size', 13)])
0.9861111111111112<jupyter_text>1. learning rate<jupyter_code>lra, acca = result_data('learning_rate', configs, results)
lru, accm = unique_average(lra, acca)

visualize(lra, acca, lru, accm, label='learning_rate', avg_line=True, xscale='log')<jupyter_output><empty_output><jupyter_text>2. Kernel Size<jupyter_code>ksa, acca = result_data('kernel_size', configs, results)
ksu, accm = unique_average(ksa, acca)

visualize(ksa, acca, ksu, accm, label='kernel_size', avg_line=True)<jupyter_output><empty_output><jupyter_text>2-1. Only lr = 1e-3<jupyter_code>ids = np.where(lra==1e-3)[0]
ksa_c, acca_c = ksa[ids], acca[ids]
ksu_c, accm_c = unique_average(ksa_c, acca_c)

visualize(ksa_c, acca_c, ksu_c, accm_c, label='kernel_size', avg_line=True)<jupyter_output><empty_output><jupyter_text>3. Normalization<jupyter_code>nrma, acca = result_data('normalization', configs, results)
nrmu, accm = unique_average(nrma, acca)

visualize(nrma, acca, nrmu, accm, label='normalization')<jupyter_output><empty_output><jupyter_text>3-1. Only lr = 1e-3 & ks = 13<jupyter_code>ids = np.logical_and(lra==1e-3,ksa==13)
nrma_c, acca_c = nrma[ids], acca[ids]
nrmu_c, accm_c = unique_average(nrma_c, acca_c)

visualize(nrma_c, acca_c, nrmu_c, accm_c, label='normalization', avg_line=True)<jupyter_output><empty_output><jupyter_text>4. L2 regularization weight<jupyter_code>l2a, acca = result_data('l2_decay', configs, results)
l2u, accm = unique_average(l2a, acca)

visualize(l2a, acca, l2u, accm, label='l2_decay', avg_line=True)<jupyter_output><empty_output><jupyter_text>4-1. Only lr = 1e-3 & ks = 13<jupyter_code>ids = np.logical_and(lra==1e-3,ksa==13)
l2a_c, acca_c = l2a[ids], acca[ids]
l2u_c, accm_c = unique_average(l2a_c, acca_c)

visualize(l2a_c, acca_c, l2u_c, accm_c, label='l2_decay', avg_line=True)
visualize(l2a_c[1:], acca_c[1:], l2u_c[1:], accm_c[1:], label='l2_decay', avg_line=True, xscale='log')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16741935483870968, 'fraction_numerical': 0.0332258064516129, 'mean_word_length': 7.809659090909091, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '652319', 'license': 'MIT', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1337, 'n_words': 232, 'path': 'results/exp1_result.ipynb', 'repo_name': 'michael-1003/EfficientNet-1D', 'size': '3100'}