for fold in range(n_folds):
            # weights explained: gat.estimator_[time_point][fold].steps[-1][-1].coef_
            weights.append(
                np.vstack([
                    gat.estimators_[idx][fold].steps[-1][-1].coef_
                    for idx in range(len(epochs.times))
                ]))
        np.save(fname_weights, np.array(weights))
        cov = mne.compute_covariance(epochs)
        cov.save(fname_cov)

    # define a layout
    layout = mne.find_layout(epochs.info)
    # additional properties
    group_dict['layout'] = layout
    group_dict['times'] = epochs.times
    group_dict['sfreq'] = epochs.info['sfreq']

else:
    group_dict = pickle.load(open(fname_group))
    subjects = group_dict['subjects']

####################
# Group Statistics #
####################
group_dict.update(
    group_stats(subjects, path, exp, filt, analysis, c_name,
                reg_type=reg_type))

pickle.dump(group_dict, open(fname_group, 'w'))
                                       train_times=train_times,
                                       clf=clf,
                                       cv=n_folds)
        gat.fit(epochs, y=y)
        gat.score(epochs, y=y)
        np.save(fname_gat, gat.scores_)

        # store weights
        weights = list()
        for fold in range(n_folds):
            # weights explained: gat.estimator_[time_point][fold].steps[-1][-1].coef_
            weights.append(
                np.vstack([
                    gat.estimators_[idx][fold].steps[-1][-1].coef_
                    for idx in range(len(epochs.times))
                ]))
        np.save(fname_weights, np.array(weights))
        cov = mne.compute_covariance(epochs)
        cov.save(fname_cov)

else:
    group_dict = pickle.load(open(fname_group))
    subjects = group_dict['subjects']

####################
# Group Statistics #
####################
group_dict = group_stats(subjects, path, exp, filt, analysis, c_names)

pickle.dump(group_dict, open(fname_group, 'w'))