This file contains hidden or 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 | |
| import matplotlib.pyplot as plt | |
| from scipy.optimize import curve_fit | |
| def model1(x, k): | |
| return k * x | |
| def model2(x, k, a): | |
| return k * x + x * np.sin(a * x) |
This file contains hidden or 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 pandas as pd | |
| import numpy as np | |
| from sklearn.feature_extraction import DictVectorizer | |
| def encode_onehot(df, cols): | |
| """ | |
| One-hot encoding is applied to columns specified in a pandas DataFrame. | |
| Modified from: https://gist.github.com/kljensen/5452382 | |
This file contains hidden or 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 scipy.stats import gaussian_kde | |
| def get_cdf_of_difference(data_1, data_2, diff_value=0): | |
| data_1 = np.asarray(data_1) | |
| data_2 = np.asarray(data_2) | |
| kde_1 = gaussian_kde(data_1) | |
| data_1.sort() | |
| data_2.sort() |
This file contains hidden or 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 | |
| import seaborn | |
| from keras.layers import Input, Dense, merge, ELU, Dropout | |
| from keras.models import Model | |
| from keras.regularizers import l2 | |
| from keras import backend as K | |
| from keras.optimizers import rmsprop, adam |
This file contains hidden or 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
| #!/usr/bin/env python | |
| """ | |
| Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction. | |
| """ | |
| from __future__ import print_function, division | |
| import numpy as np | |
| from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten | |
| from keras.models import Sequential |
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # Build GCC with support for offloading to NVIDIA GPUs. | |
| # | |
| work_dir=$HOME/offload/wrk | |
| install_dir=$HOME/offload/install | |
| # Location of the installed CUDA toolkit |
This file contains hidden or 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 pickle | |
| import numpy as np | |
| import pymc3 as pm | |
| import matplotlib.pyplot as plt | |
| def fit_robustly(t, y, yerr, draws=500, chains=None, njobs=4, tune=500, | |
| n_new=None, t_new=None, show_traceplot=False, | |
| show_fitted_GP=True, file_fig=None, progressbar=True): | |
| """ |
This file contains hidden or 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 | |
| import george | |
| import pickle | |
| from functools import partial | |
| import scipy.optimize as op | |
| import matplotlib.pyplot as plt | |
| def is_embraced(curve, means, widths): | |
| """ |
This file contains hidden or 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 pickle | |
| import numpy as np | |
| from scipy.optimize import minimize | |
| import celerite | |
| from celerite import terms | |
| import emcee | |
| import matplotlib.pyplot as plt | |
| # Ilya: We only need x, y, yerr 1D arrays. Substitute your's | |
| with open("0716+714_umrao_lc.pkl", "rb") as fo: |
This file contains hidden or 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 | |
| import george | |
| import emcee | |
| import pickle | |
| from functools import partial | |
| import scipy.optimize as op | |
| import matplotlib.pyplot as plt | |
| from tqdm import tqdm | |