Skip to content

Instantly share code, notes, and snippets.

View live-wire's full-sized avatar

Dhruv Batheja live-wire

View GitHub Profile
from graphviz import Digraph
import torch
from torch.autograd import Variable, Function
def iter_graph(root, callback):
queue = [root]
seen = set()
while queue:
fn = queue.pop()
if fn in seen:
@live-wire
live-wire / toc.py
Created August 29, 2018 19:15
Markdown Table of Contents Generator (Just add <toc> to your markdown and it will be replaced by the Table of contents when you run this script)
import re
import sys
stringtoreplace = "<toc>"
def generateTOC(filename):
contents = []
with open(filename, "r") as ins:
for line in ins:
@live-wire
live-wire / preparation.ipynb
Created March 25, 2018 04:55
MNIST challenge for EvalAI data preparation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@live-wire
live-wire / mnist.md
Last active April 6, 2018 13:17
MNIST Challenge creation for EvalAI

MNIST challenge creation for EvalAI

A tutorial on how I created the mnist-challenge

I started with going through this documentation about challenge creation. This involves creation of a yaml configuration file for the challenge.

Before we dive into the configuration, we need to establish a few things about the platform. Each challenge is split into phases decided by the host (us in this scenario). The host can have different dataset splits for different challenge phases. The host can set the visibility of the challenge phases and also of the leaderboards to HOST, OWNER & HOST or PUBLIC. The number and types of columns in the leaderboard is also configurable.

Configuration

Let me use the configuration I created for the challenge and go through it line by line:

@live-wire
live-wire / main.py
Created March 22, 2018 18:46
EvalAI sample evaluation script for the VQA challenge
"""
Input: GT JSON file, Pred JSON file, Phase-CodeName
Hardcoded path of a split-JSON file which has the following structure
Split JSON File Structure -
{
split1 : [list of qids]
split2 : [list of qids]
split3 : [list of qids]
split4 : [list of qids]