Skip to content

Instantly share code, notes, and snippets.

Jean-Rémi KING kingjr

Block or report user

Report or block kingjr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View extract_2d.py
import mne
import numpy as np
import matplotlib.pyplot as plt
import scipy
import torch
from itertools import product
import pandas as pd
import seaborn as sns
def cart_to_pol(x, y):
View plot_arch.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:334fe4d7968b931eb18f6af5b003c397
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
@kingjr
kingjr / block_ridge.py
Last active Dec 20, 2019
block ridge: WIP
View block_ridge.py
from sklearn.linear_model import RidgeCV
import numpy as np
from scipy import linalg
class BlockRidgeCV(RidgeCV):
def __init__(self, alphas, blocks, fit_intercept=False, **kwargs):
super().__init__(**kwargs)
self.fit_intercept = False
self.alphas = alphas
View for_danilo.py
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.cross_decomposition import PLSRegression
from sklearn.model_selection import cross_val_score
from scipy.stats import pearsonr
ols = LinearRegression()
pls = PLSRegression()
@kingjr
kingjr / arch_plots.py
Last active Dec 6, 2019
architecture_plot
View arch_plots.py
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
n_layers = 4
n_steps = 4
fig, axes = plt.subplots(1, 3, sharex=True, sharey=True, figsize=[10, 3])
View example_text_generation.py
import sys
import os
import os
import numpy as np
import torch
import matplotlib.pyplot as plt
sys.path.append(os.path.abspath('./sentence_embedding'))
from utils import load_model, build_XLM_dictionary # noqa
@kingjr
kingjr / linear_or_categorical.py
Last active Feb 22, 2019
linear_or_categorical.py
View linear_or_categorical.py
"""Fit sigmoid with parallel seeds to find global minimum.
"""
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
from scipy.stats import pearsonr, wilcoxon
from sklearn.base import BaseEstimator
from sklearn.model_selection import StratifiedKFold
from sklearn.linear_model import LinearRegression
@kingjr
kingjr / fit_sigmoid.py
Created Feb 22, 2019
Fit sigmoid with parallel seeds to find global minimum.
View fit_sigmoid.py
"""Fit sigmoid with parallel seeds to find global minimum.
"""
import matplotlib.pyplot as plt
import numpy as np
from sklearn.base import BaseEstimator
import torch
import torch.nn as nn
class SigmoidRegression(BaseEstimator):
@kingjr
kingjr / for_theo_nonlin_cmap.ipynb
Last active Dec 20, 2018
for theo: non lin colormap
View for_theo_nonlin_cmap.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.