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
# IPython magic to check for PEP8 compliance. | |
# Author: Juan Luis Cano <juanlu001@gmail.com> | |
"""IPython magic to check for PEP8 compliance. | |
To use it, type | |
```%load_ext pep8magic``` | |
and then |
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
# Author: Kyle Kastner | |
# License: BSD 3-clause | |
# Thanks to Jose (@sotelo) for tons of guidance and debug help | |
# Credit also to Junyoung (@jych) and Shawn (@shawntan) for help/utility funcs | |
# Strangeness in init could be from onehots, via @igul222. Ty init for one hot layer as N(0, 1) just as in embedding | |
# since oh.dot(w) is basically an embedding | |
import os | |
import re | |
import tarfile | |
from collections import Counter |
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
###### | |
# author: Stefan McKinnon Edwards <stefan.hoj-edwards@agrsci.dk> | |
# id: $Id: qsub1.py 25 2013-04-12 11:06:47Z sme $ | |
# qsub-module; | |
# communicates with cluster-queueing system to retrieve information | |
# about the current job. | |
# The qsub commands do no exist on the nodes, so to retrieve the necessary information, | |
# we ssh the host and request the information from `qstat`. | |
# | |
# To use this module from a script running on a computation cluster, |
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 | |
import warnings | |
from itertools import cycle, izip | |
from sklearn.utils import gen_even_slices | |
from sklearn.utils import shuffle | |
from sklearn.base import BaseEstimator | |
from sklearn.base import ClassifierMixin | |
from sklearn.preprocessing import LabelBinarizer |
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 sklearn.cross_validation import train_test_split | |
from keras.preprocessing import sequence, text | |
from keras.models import Sequential | |
from keras.layers import (Dense, Dropout, Activation, Embedding, LSTM, | |
Convolution1D, MaxPooling1D) | |
# Embedding | |
max_features = 20000 | |
maxlen = 100 | |
embedding_size = 32 |
#How to use blast from command-line, on Mac OS X.
Download executables (binary) of blast-commands for Mac OS X.
$ curl -O ftp://ftp.ncbi.nih.gov/blast/executables/blast+/2.2.28/ncbi-blast-2.2.28+.dmg
or
$ wget ftp://ftp.ncbi.nih.gov/blast/executables/blast+/2.2.28/ncbi-blast-2.2.28+.dmg
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 torch | |
from torch.autograd import Variable | |
# new way with `init` module | |
w = torch.Tensor(3, 5) | |
torch.nn.init.normal(w) | |
# work for Variables also | |
w2 = Variable(w) | |
torch.nn.init.normal(w2) | |
# old styled direct access to tensors data attribute |
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
"""A stripped-down MLP example, using Theano. | |
Based on the tutorial here: http://deeplearning.net/tutorial/mlp.html | |
This example trims away some complexities, and makes it easier to see how Theano works. | |
Design changes: | |
* Model compiled in a distinct function, so that symbolic variables are not in run-time scope. | |
* No classes. Network shown by chained function calls. |
OlderNewer