๐
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 os | |
| import tensorflow as tf | |
| AUTOTUNE = tf.data.experimental.AUTOTUNE | |
| def _parse_batch(record_batch, sample_rate, duration): | |
| n_samples = sample_rate * duration | |
| # Create a description of the features |
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
| class Transformer(tf.keras.models.Model): | |
| def __init__(self, embed_dim=16, n_heads=4, max_pos=1000, input_vocab_size=1500, target_vocab_size=2000, | |
| encoder_layers=2, decoder_layers=2, fc_layers=2, norm_epsilon=1e-6, dropout_rate=0.2, | |
| fc_activation=tf.keras.activations.relu): | |
| super(Transformer, self).__init__() | |
| assert embed_dim % n_heads == 0 | |
| self.n_heads = n_heads | |
| self.embed_dim = embed_dim | |
| self.depth = embed_dim // n_heads |
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
| In [1]: n = 10000000 | |
| In [2]: x = rand(n) | |
| In [3]: X = fft(x) | |
| In [4]: rms_flat(x) | |
| Out[4]: 0.57731639149367697 | |
| In [5]: rms_flat(ifft(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
| source | target | weight | |
|---|---|---|---|
| sam | tully | 3 | |
| sam | pat | 8 | |
| sam | kim | 2 | |
| sam | pris | 1 | |
| roy | pris | 5 | |
| roy | sam | 1 | |
| tully | sam | 1 | |
| tully | pris | 5 | |
| tully | kim | 3 |
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 6 columns, instead of 4 in line 8.
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
| datasetName,about,link,categoryName,cloud,vintage | |
| Microbiome Project,American Gut (Microbiome Project),https://github.com/biocore/American-Gut,Biology,GitHub,NA | |
| GloBI,Global Biotic Interactions (GloBI),https://github.com/jhpoelen/eol-globi-data/wiki#accessing-species-interaction-data,Biology,GitHub,NA | |
| Global Climate,Global Climate Data Since 1929,http://en.tutiempo.net/climate,Climate/Weather,,1929 | |
| CommonCraw 2012,3.5B Web Pages from CommonCraw 2012,http://www.bigdatanews.com/profiles/blogs/big-data-set-3-5-billion-web-pages-made-available-for-all-of-us,Computer Networks,,2012 | |
| Indiana Webclicks,53.5B Web clicks of 100K users in Indiana Univ.,http://cnets.indiana.edu/groups/nan/webtraffic/click-dataset/,Computer Networks,,NA | |
| Criteo click-through,Criteo click-through data,http://labs.criteo.com/2015/03/criteo-releases-its-new-dataset/,Computer Networks,,NA | |
| ICWSM 2009,ICWSM Data Challenge (since 2009),http://icwsm.cs.umbc.edu/,Data Challenges,,2009 | |
| KDD Cup,KDD Cup by Tencent 2012,http://www.kddcup2012.org/,Data |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.22.0"></script> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.22.0"></script> | |
| <script type="text/javascript" src="readme.js"></script> | |
| <style type="text/css"> | |
| .node { |
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
| license: gpl-3.0 | |
| height: 960 | |
| border: no | |
| redirect: https://observablehq.com/@d3/hierarchical-edge-bundling |
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
| name: kaggle | |
| channels: | |
| - defaults | |
| dependencies: | |
| - backcall=0.1.0=py36_0 | |
| - bleach=2.1.3=py36_0 | |
| - ca-certificates=2018.03.07=0 | |
| - certifi=2018.4.16=py36_0 | |
| - dbus=1.13.2=h714fa37_1 | |
| - decorator=4.3.0=py36_0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| from sshtunnel import SSHTunnelForwarder | |
| from sqlalchemy import create_engine | |
| from sqlalchemy.orm import sessionmaker | |
| from functools import wraps | |
| # secrets.py contains credentials, etc. | |
| import secrets | |
| def get_engine_for_port(port): | |
| return create_engine('postgresql://{user}:{password}@{host}:{port}/{db}'.format( |