Gamma trial experiment

import sys, os
import warnings
import tqdm
import random
import pandas as pd
import numpy as np

import matplotlib.pyplot as plt

# Insert path to model directory,.
cwd = os.getcwd()
path = f"{cwd}/../../src"
sys.path.insert(0, path)

# toy datasets
from data.toy import RBIGData

# Experiments
from experiments.param_space import ExperimentGamma

# Kernel Dependency measure
from models.dependence import HSIC, train_rbf_hsic
from models.kernel import estimate_sigma, sigma_to_gamma, gamma_to_sigma, get_param_grid

# RBIG IT measures
from models.ite_algorithms import run_rbig_models

import scipy.io as scio

import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline

warnings.filterwarnings('ignore') # get rid of annoying warnings

%load_ext autoreload
%autoreload 2
The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload
SAVE_PATH = "/home/emmanuel/projects/2019_hsic_align/results/hsic/"

clf_exp = ExperimentGamma(
    seed=123,
    n_trials=1,
    mi_points=10_000,
    n_noise=50,
    n_gamma=50,
    factor=2,
    sigma_est='median',
    save_path=SAVE_PATH,
    save_name='gamma_v1_median',
)

# run full experiment
clf_exp.run_experiment()
Function: line
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-6-92a6f1263002> in <module>
     14 
     15 # run full experiment
---> 16 clf_exp.run_experiment()

~/projects/2019_hsic_align/notebooks/2_gamma_parameter/../../src/experiments/param_space.py in run_experiment(self)
    121                                 hsic_method,
    122                                 hsic_score,
--> 123                                 mi_score,
    124                             )
    125 

~/projects/2019_hsic_align/notebooks/2_gamma_parameter/../../src/experiments/param_space.py in append_results(self, results_df, function, trial, noise, init_gamma, gamma, hsic_method, hsic_score, mi_score)
    234                 "mi": mi_score,
    235             },
--> 236             ignore_index=True,
    237         )
    238 

~/.conda/envs/it4dnn/lib/python3.6/site-packages/pandas/core/frame.py in append(self, other, ignore_index, verify_integrity, sort)
   7121             ignore_index=ignore_index,
   7122             verify_integrity=verify_integrity,
-> 7123             sort=sort,
   7124         )
   7125 

~/.conda/envs/it4dnn/lib/python3.6/site-packages/pandas/core/reshape/concat.py in concat(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity, sort, copy)
    256     )
    257 
--> 258     return op.get_result()
    259 
    260 

~/.conda/envs/it4dnn/lib/python3.6/site-packages/pandas/core/reshape/concat.py in get_result(self)
    471 
    472             new_data = concatenate_block_managers(
--> 473                 mgrs_indexers, self.new_axes, concat_axis=self.axis, copy=self.copy
    474             )
    475             if not self.copy:

~/.conda/envs/it4dnn/lib/python3.6/site-packages/pandas/core/internals/managers.py in concatenate_block_managers(mgrs_indexers, axes, concat_axis, copy)
   2052         else:
   2053             b = make_block(
-> 2054                 concatenate_join_units(join_units, concat_axis, copy=copy),
   2055                 placement=placement,
   2056             )

~/.conda/envs/it4dnn/lib/python3.6/site-packages/pandas/core/internals/concat.py in concatenate_join_units(join_units, concat_axis, copy)
    251     to_concat = [
    252         ju.get_reindexed_values(empty_dtype=empty_dtype, upcasted_na=upcasted_na)
--> 253         for ju in join_units
    254     ]
    255 

~/.conda/envs/it4dnn/lib/python3.6/site-packages/pandas/core/internals/concat.py in <listcomp>(.0)
    251     to_concat = [
    252         ju.get_reindexed_values(empty_dtype=empty_dtype, upcasted_na=upcasted_na)
--> 253         for ju in join_units
    254     ]
    255 

~/.conda/envs/it4dnn/lib/python3.6/site-packages/pandas/core/internals/concat.py in get_reindexed_values(self, empty_dtype, upcasted_na)
    234         else:
    235             for ax, indexer in self.indexers.items():
--> 236                 values = algos.take_nd(values, indexer, axis=ax, fill_value=fill_value)
    237 
    238         return values

~/.conda/envs/it4dnn/lib/python3.6/site-packages/pandas/core/algorithms.py in take_nd(arr, indexer, axis, out, fill_value, mask_info, allow_fill)
   1717 
   1718     func = _get_take_nd_function(
-> 1719         arr.ndim, arr.dtype, out.dtype, axis=axis, mask_info=mask_info
   1720     )
   1721     func(arr, indexer, out, fill_value)

~/.conda/envs/it4dnn/lib/python3.6/site-packages/pandas/core/algorithms.py in _get_take_nd_function(ndim, arr_dtype, out_dtype, axis, mask_info)
   1481 def _get_take_nd_function(ndim, arr_dtype, out_dtype, axis=0, mask_info=None):
   1482     if ndim <= 2:
-> 1483         tup = (arr_dtype.name, out_dtype.name)
   1484         if ndim == 1:
   1485             func = _take_1d_dict.get(tup, None)

~/.conda/envs/it4dnn/lib/python3.6/site-packages/numpy/core/_dtype.py in _name_get(dtype)
    325 
    326     # Builtin classes are documented as returning a "bit name"
--> 327     name = dtype.type.__name__
    328 
    329     # handle bool_, str_, etc

KeyboardInterrupt: