Skip to content

Instantly share code, notes, and snippets.

View jaidevd's full-sized avatar

Jaidev Deshpande jaidevd

View GitHub Profile
@jaidevd
jaidevd / pycon-india-code-of-conduct-addenda.md
Last active March 18, 2017 07:33
A rant disguised as a code of conduct

Things that the regular code of conduct missed out

  1. Thou shalt not slam the door when thou leaveth the auditorium.
  2. Thou shalt take care not to kick the seat in front of you in the auditorium.
  3. Thou shalt make sure that thy phone is silenced.
  4. Thou shalt not jump the queue for lunch or tea.
  5. Thou shalt speak only in whispers if a session is in progress.
@jaidevd
jaidevd / w2v_keras_functional.py
Created March 22, 2018 14:37
Sample W2V script in keras
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
Training Word embeddings on the MTsamples dataset.
"""
from keras.models import Model
from keras.layers import Dense, Embedding, Input, Reshape, Dot
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
from __future__ import print_function
for i in range(1, 10):
print(i)
if i % 2 == 0:
exit
@jaidevd
jaidevd / test.py
Created May 9, 2018 07:36
inheritance in tests
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# JSM product code
#
# (C) Copyright 2018 Juxt SmartMandate Pvt Ltd
# All right reserved.
#
# This file is confidential and NOT open source. Do not distribute.
```
for each epochs:
* divide the training data into minibatches
for each minibatch:
* backpropagate and update weights
```
@jaidevd
jaidevd / dl_avdhs.md
Created September 11, 2018 10:31
Deep Learning with the Scientific Method

Deep Learning with the Scientific Method

The Problem

As technology becomes cheaper and more available, we start taking it for granted. Nowhere is this more true than in machine learning. As machines become cheaper and data becomes more and more voluminous, our approach to specific machine learning problems often, and understandably, becomes haphazard. Since GPUs are much cheaper and more widely available than ever before, we implicitly believe that throwing enough artificial neurons at a problem will eventually solve it. While this by itself may be true, it is not uncommon for ML practitioners to realize - unfortunately only in hindsight - that most of the iterations required to build a successful predictive model were unnecessary. Ironically, these 'missteps' are often what lead us to the correct answer. Solving a machine learning problem is like traversing a minefield, where the safest path can only be determined by blowing up a significantly large number of mines. You can only figure out the right a

@jaidevd
jaidevd / antonyms.py
Created February 10, 2020 02:42
Wordnet antonyms
#!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().run_line_magic('load_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
@jaidevd
jaidevd / scatterplot.json
Created April 22, 2020 02:51
Vega scatterplot
{
"$schema": "https://vega.github.io/schema/vega/v4.json",
"description": "https://gramener.invisionapp.com/d/main/#/console/7709561/326727774/preview",
"width": 495,
"height": 320,
"autosize": "fit",
"padding": {
"left": 5,
"top": 25,
"right": 100,
@jaidevd
jaidevd / date.csv
Created April 23, 2020 14:13
US Presidents
label born died enter leave
Washington 1732-02-22 13:53:28 1799-12-14 11:53:28 1789-04-30 12:53:28 1797-03-04 13:53:28
Adams 1735-10-30 12:53:28 1826-07-04 12:53:28 1797-03-04 13:53:28 1801-03-04 13:53:28
Jefferson 1743-04-13 12:53:28 1826-07-04 12:53:28 1801-03-04 13:53:28 1809-03-04 13:53:28
Madison 1751-03-16 12:53:28 1836-06-28 12:53:28 1809-03-04 13:53:28 1817-03-04 13:53:28
Monroe 1758-04-28 12:53:28 1831-07-04 12:53:28 1817-03-04 13:53:28 1825-03-04 13:53:28
@jaidevd
jaidevd / heatmap.json
Last active April 27, 2020 03:16
Vega Heatmap
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "A heatmap showing average daily temperatures in Seattle for each hour of the day.",
"width": 800,
"height": 500,
"padding": 5,
"title": {
"text": "Seattle Annual Temperatures",
"anchor": "middle",