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
{ | |
"toc2": { | |
"number_sections": false, | |
"skip_h1_title": false, | |
"toc_cell": false | |
}, | |
"load_extensions": { | |
"plotlywidget/extension": true, | |
"jupyter-js-widgets/extension": true, | |
"contrib_nbextensions_help_item/main": true, |
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
''' | |
The purpose of this script is to quickly collect a large number of abstracts | |
from argiv.org so to simplify scanning lots of documents on a single topic | |
before committing the time to do an in-depth reading of any particular paper. | |
@author formigone | |
''' | |
import requests | |
import re |
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 collections import namedtuple | |
_Activity = namedtuple('Activity', ['activityId', 'studentId', 'timeRead']) | |
_Activity.__new__.__defaults__ = (None, None, 0.0) | |
class Activity(_Activity): | |
@staticmethod | |
def from_dict(args): | |
args = {k: v for k, v in args.items() if k in _Activity._fields} |
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
#notebook-container{ | |
box-shadow: none !important; | |
} | |
.container { | |
width: 80% !important; | |
} | |
.notebook_app { | |
background: #fff !important; |
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
query = ''' | |
{ | |
users { | |
id | |
created | |
firstName | |
lastName | |
} | |
} |
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
def model_fn(features, labels, mode, params): | |
word_vec = embed_sequence(features, vocab_size=params['vocab_size'], embed_dim=params['embed_size']) | |
# [-1, seq_len, embed_size] | |
word_list = tf.unstack(word_vec, axis=1) | |
# [-1, embed_size] | |
cell = tf.nn.rnn_cell.GRUCell(params['embed_size']) | |
_, encoding = tf.nn.static_rnn(cell, word_list, dtype=tf.float32) | |
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
def list_to_tfrecord(list, tfrecord_filename): | |
""" | |
Convert a list of (features, labels) to a TFRecord file. | |
param list: a list of tuples with (feature, label) | |
""" | |
with python_io.TFRecordWriter(tfrecord_filename) as writer: | |
for feature, label in list: | |
example = tf.train.Example() | |
example.features.feature['x'].float_list.value.extend(features) |
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
function transpose(mat){ | |
return mat[0].map((_, y) => { | |
return mat.map((_, x) => { | |
return mat[x][y]; | |
}); | |
}); | |
} | |
var mat0 = [ | |
[0, 1, 2, 3, 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
function mult(a, b){ | |
return a.map((row) => { | |
return b[0].map((col, j) => { | |
return row.reduce((acc, a0, i) => (acc + a0 * b[i][j]), 0); | |
}); | |
}) | |
} | |
var mat0 = [ | |
[1, 2, 3, 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
<!doctype html> | |
<html> | |
<head> | |
<title>mp4</title> | |
<style> | |
.emVid { | |
position: relative; | |
bottom: 0; | |
left: 0; |
NewerOlder