Skip to content

Instantly share code, notes, and snippets.

View minesh1291's full-sized avatar
๐Ÿš–
On The Journey to Neverland

Minesh A. Jethva minesh1291

๐Ÿš–
On The Journey to Neverland
View GitHub Profile
@minesh1291
minesh1291 / load_tfrecords.py
Created January 10, 2022 10:17 — forked from dschwertfeger/load_tfrecords.py
A data-pipeline using TFRecords
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
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
@minesh1291
minesh1291 / example.txt
Created October 16, 2021 03:46 — forked from endolith/example.txt
Parseval's theorem Python NumPy example
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))
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.
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
@minesh1291
minesh1291 / index.html
Created August 30, 2021 02:55 — forked from fod/index.html
Hierarchical Edge Bundling (D3)
<!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 {
@minesh1291
minesh1291 / .block
Created August 30, 2021 01:31 — forked from mbostock/.block
Hierarchical Edge Bundling
license: gpl-3.0
height: 960
border: no
redirect: https://observablehq.com/@d3/hierarchical-edge-bundling
@minesh1291
minesh1291 / kaggle.yml
Created August 8, 2021 18:09 — forked from benjamintanweihao/kaggle.yml
Conda environment for Kaggle
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.
@minesh1291
minesh1291 / with_sql_session.py
Created June 16, 2021 13:58 — forked from danallison/with_sql_session.py
Connect to Postgresql locally or through SSH tunnel
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(