Skip to content

Instantly share code, notes, and snippets.

View apsdehal's full-sized avatar

Amanpreet Singh apsdehal

View GitHub Profile
n01440764 tench, Tinca tinca
n01443537 goldfish, Carassius auratus
n01484850 great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias
n01491361 tiger shark, Galeocerdo cuvieri
n01494475 hammerhead, hammerhead shark
n01496331 electric ray, crampfish, numbfish, torpedo
n01498041 stingray
n01514668 cock
n01514859 hen
n01518878 ostrich, Struthio camelus
@apsdehal
apsdehal / plot_mmf_train_log.py
Last active April 24, 2021 09:56
This can be used to plot a train.log from MMF using plotly. Update `JOBS_BASEPATH` to point to your save folders and `METRIC` variable to point to metric that you want to plot.
import sys
import os
import numpy as np
import json
from collections import defaultdict
import seaborn
import glob
import random
import plotly
[ optional arguments: ]
[ num_examples: 10 ]
[ Main ParlAI Arguments: ]
[ task: narrative_qa ]
[ download_path: /home/apsdehal/projects/forks/ParlAI/downloads ]
[ datatype: train ]
[ image_mode: raw ]
[ numthreads: 1 ]
[ datapath: /home/apsdehal/projects/forks/ParlAI/data ]
[ Batching Arguments: ]
( function() {
requirejs.config({
paths: {
"globalize": "../../../external/globalize/globalize",
"globalize/ja-JP": "../../../external/globalize/globalize.culture.ja-JP",
"jquery": jqueryUrl(),
"jquery-simulate": "../../../external/jquery-simulate/jquery.simulate",
"jshint": "../../../external/jshint/jshint",
"lib": "../../lib",
Listening on 0.0.0.0:9000
Tunnel startedcal v3.7
‣ Created session firefox on any platform (ccf422526d61e9ac72a763723aefabdd8579ba08)
>> Suite firefox on any platform - unit tests FAILED
UnknownError: [POST http://(redacted)@hub.browserstack.com:4444/wd/hub/session/ccf422526d61e9ac72a763723aefabdd8579ba08/url / {"url":"http://localhost:9000/__intern/client.html?config=test%2Fintern&suites=test%2Funit%2Fall&basePath=%2F&initialBaseUrl=%2F&reporters=WebDriver&rootSuiteName=firefox%20on%20any%20platform%20-%20unit%20tests&sessionId=ccf422526d61e9ac72a763723aefabdd8579ba08"}] Session not started or terminated
at ProxiedSession._post <node_modules/intern/node_modules/leadfoot/Session.js:59:30>
at ProxiedSession.Session.get <node_modules/intern/node_modules/leadfoot/Session.js:523:15>
at <node_modules/intern/lib/ProxiedSession.js:86:25>
at getFinalValue <node_modules/intern/node_modules/dojo/Promise.ts:462:21>
at <node_modules/intern/node_modules/dojo/Promise.ts:482:10>
Running "intern:globalize" (intern) task
ReferenceError: module is not defined
at Promise.then.setConfig <node_modules/intern/lib/executors/PreExecutor.js:405:10>
at new Promise <node_modules/intern/node_modules/dojo/Promise.ts:411:3>
at PreExecutor.swapLoader <node_modules/intern/lib/executors/PreExecutor.js:388:11>
at swapLoader <node_modules/intern/lib/executors/PreExecutor.js:350:17>
at <node_modules/intern/node_modules/dojo/Promise.ts:393:15>
at runCallbacks <node_modules/intern/node_modules/dojo/Promise.ts:11:11>
at <node_modules/intern/node_modules/dojo/Promise.ts:317:4>
at Object.run [as _onImmediate] <node_modules/intern/node_modules/dojo/Promise.ts:237:7>
Running "intern:globalize" (intern) task
Listening on 0.0.0.0:9000
Starting tunnel...
Initialised chrome 43.0.2357.65 on Mac OS X
>> Test main - Globalize (constructor) - should lookup bundle FAILED on chrome 43.0.2357.65 on Mac OS X:
AssertionError: expected [Function] to throw 'E_MISSING_BUNDLE' but 'Error: E_MISSING_BUNDLE: {"locale":"xx-XZ"}' was thrown
at Function.assert.Throw <__intern/node_modules/chai/chai.js:3241:47>
at Object.throws <__intern/lib/interfaces/qunit.js:27:17>
at Object.<anonymous> <test/unit/core.js:101:9>
at Test.test <__intern/lib/interfaces/qunit.js:151:10>
@apsdehal
apsdehal / Railway Stations
Created April 29, 2014 07:37
JSON file containing all stations and their codes.
{"data":[{"name":"ABU ROAD", "code":"ABR"},
{"name":"ACHHNERA", "code":"AH"},
{"name":"ADONI", "code":"AD"},
{"name":"ADRA", "code":"ADRA"},
{"name":"AGRA FORT", "code":"AF"},
{"name":"AGRA CANTT.", "code":"AGC"},
{"name":"AHMADNAGAR", "code":"ANG"},
{"name":"AHMEDABAD", "code":"ADI"},
{"name":"AJMER", "code":"AII"},
{"name":"AKOLA", "code":"AK"},