This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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): |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
x = np.linspace(-10, 10) | |
y = np.cos(x) / 2. + .5 | |
z = np.sin(x) / 20. + .5 | |
def jr_transform(x, baseline=.50, scaling=100): | |
x = x - baseline | |
above = np.log(scaling*x*(x>0)+1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
sudo apt-get install python-dev graphviz libgraphviz-dev pkg-config | |
pip install pygraphviz | |
""" | |
%matplotlib inline | |
import numpy as np | |
import os | |
import networkx as nx | |
from networkx.drawing.nx_agraph import to_agraph | |
from IPython.display import Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.linear_model import RidgeCV | |
from matplotlib import pyplot as plt | |
from sklearn.linear_model import LinearRegression | |
from sklearn.model_selection import cross_val_predict, KFold | |
def correlation(x, y): | |
a = (x - x.mean(0)) / x.std(0) | |
b = (y - y.mean(0)) / y.std(0) |
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 3 columns, instead of 2. in line 4.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input,output,size | |
hco hco hco hco hco hco hco hco hco hco hco hco hco hco hco hco hco hco hco hco,"Frequently Asked Questions (FAQ) Contact Us Archive Top All times are GMT +7. The time now is. Contact Us Archive Top All times are GMT +7. The time now is Powered by vBulletin® Version 4.1.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.",31 | |
kpy kpy kpy kpy kpy kpy kpy kpy kpy kpy kpy kpy kpy kpy kpy kpy kpy kpy kpy kpy,"Prices are without VAT and are therefore not included in the price. If you have any questions, ask them and we will contact you as soon as possible.",24 | |
ejd ejd ejd ejd ejd ejd ejd ejd ejd ejd ejd ejd ejd ejd ejd ejd ejd ejd ejd ejd,list of other guests. Payment is usually accepted in the quoted currency (Euro) unless the currency and the amount is specifically agreed in advance with the owner / advertiser.,23 | |
hiu hiu hiu hiu hiu hiu hiu hiu hiu hiu hiu hiu hiu hiu hiu hiu hiu hiu hiu hiu,be sure to check out the FAQ by clicking the link above. You may have to register before y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from googletrans import Translator | |
from itertools import product | |
from pandas import DataFrame, read_csv | |
import numpy as np | |
import string | |
import time | |
import os | |
# Get google translator object | |
translator = Translator() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Wang and Wong 2006 perceptual decision making model | |
adapted from https://github.com/xjwanglab/book/blob/b0a8e775a9f687cefbcbb4fcbe3fc19b6343bd70/wong2006/wong2006.py # noqa | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def run(coherence=.3): |