Skip to content

Instantly share code, notes, and snippets.

View holmesal's full-sized avatar
:bowtie:
makin'

Alonso Holmes holmesal

:bowtie:
makin'
View GitHub Profile
model = LinearRegressionModel();
print(model);
# stick our data in a dataframe:
df = pd.DataFrame({'x': x, 'y': y});
# use 20% of our data for validation:
valid_idx = random.sample(list(df.index), int(0.2 * len(df)));
# what we're predicting:
dep_var = 'y'
# we don't have any categorical variables:
plt.plot(x, y, 'go', label = 'from data', alpha = .5)
plt.legend()
plt.show()
plt.clf()
num_datapoints = 1000
x = np.random.rand(num_datapoints)
# our model will guess m and b:
m = 7;
b = 13;
f = 2;
# high school flashbacks
y = m * x + b;
class LinearRegressionModel(nn.Module):
def __init__(self):
super(LinearRegressionModel, self).__init__()
# init the layers
self.layers = nn.Sequential(
# input linear layer
nn.Linear(1, 10),
# install audiowaveform
RUN apt-get install -y wget git-core make cmake gcc g++ libmad0-dev libid3tag0-dev libsndfile1-dev libgd2-xpm-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev
WORKDIR ~
RUN git clone https://github.com/bbc/audiowaveform.git
WORKDIR audiowaveform/
RUN wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz
RUN tar xzf release-1.8.0.tar.gz
RUN ln -s googletest-release-1.8.0/googletest googletest
RUN ln -s googletest-release-1.8.0/googlemock googlemock
RUN mkdir build
@holmesal
holmesal / pre-pr-checklist.md
Last active April 7, 2017 21:03
Pre-PR Checklist

Pre-PR checklist

Did you add any Typographic components?

If so, come up with a witty name and add the type parameters to the Trello card.

Are you using any icons that don't already exist in /styleguide/icons?

If so, add the SVGs to that folder. Make sure you add both 12 and 24px sizes.

@holmesal
holmesal / pull-request-template.md
Last active December 12, 2016 23:02 — forked from Lordnibbler/pull-request-template.md
Sample Pull Request Template

Migrations

YES | NO

Description

A few sentences describing the overall goals of the pull request's commits.

Related PRs

List related PRs against other branches:

branch | PR