def load_params(model, fn):
    if 'npz' in fn:
        with np.load(fn) as f:
            param_values = [f['arr_%d' % i] for i in range(len(f.files))]
        nn.layers.set_all_param_values(model, param_values)
    else:
        with open(fn, 'r') as re:
            import pickle
            nn.layers.set_all_param_values(model, pickle.load(re))

# saves params in npz (if filename is a .npz) or pickle if not
dataset/ETHPy150Open woshialex/diagnose-heart/CNN_A/utils.py/load_params/original