Skip to content

Instantly share code, notes, and snippets.

Prithvijit Chakrabarty PCJohn

Block or report user

Report or block PCJohn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View viz_net.py
"""
Usage:
srun -p 1080ti-short --mem 100000 --gres=gpu:1 \
python tools/viz_net.py --dataset coco2017 --output_dir tmp \
--cfg configs/context/self-attn/e2e_faster_rcnn_R-50-C4_1x_attn_head-8_lr-long-v3.yaml \
--ckpt data/models/coco-visual-8-head/model_step69999.pth
Example (8 heads v3 on COCO):
srun -p 1080ti-short --gres=gpu:1 --mem 20000 python tools/viz_net.py \
@PCJohn
PCJohn / graph.py
Created Jan 14, 2019
Display graphs with networkx
View graph.py
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
import networkx as nx
import copy
class Graph:
def __init__(self,adj,labels):
self.adj = adj
self.char_list = labels
@PCJohn
PCJohn / convdiv.py
Created Jul 20, 2017
This script tries to overfit a small convolutional network, to perform integer division
View convdiv.py
"""
Attempt to perform integer division by overfitting convolution layers
Input: 2 numbers A and C
Output: Integer B such that A.B = C
Author: Prithvijit Chakrabarty (prithvichakra@gmail.com)
"""
import random
@PCJohn
PCJohn / matfact.py
Created Jun 26, 2017
NNMF by overfitting neural networks
View matfact.py
"""
Attempt to run NNMF (Non-negative matrix factorization) for integer matrices by overfitting with a high learning rate on backpropagation.
Try to factorize matrices: Find a matrix A such that xA = y for given matrices (x,y)
Author: Prithvijit Chakrabarty (prithvichakra@gmail.com)
"""
import random
import numpy as np
import tensorflow as tf
@PCJohn
PCJohn / Sieve.cpp
Last active Sep 17, 2015
An efficient sieve to factorize numbers
View Sieve.cpp
/*
This is memory saving sieve that efficiently factorizes integers below an upper limit.
It generates a structure that stores the smallest prime factor of all numbers below the limit.
Given a number, it divides it by the smallest prime factor and adds the factor to the list of factors. This is repeated till the number is reduced to 1.
Bitwise operations are used to save memory while storing the sieve encoded in a list of integers.
Author: Prithvijit Chakrabarty (prithvichakra@gmail.com)
*/
#include <vector>
@PCJohn
PCJohn / ClosedSurfaceFinder.java
Created Sep 17, 2015
Finding closed boundaries
View ClosedSurfaceFinder.java
/*Java source to find closed boundaries an array of binary pixels.
Author: Prithvijit Chakrabarty (prithvichakra@gmail.com)
*/
package projectjava;
import java.awt.Color;
public class ClosedSurfaceFinder {
@PCJohn
PCJohn / ConnectFour.java
Last active Jun 11, 2019
A Java text based game for Connect Four
View ConnectFour.java
/*Java source for a simple, text based game of Connect Four. Change the package name as required.
Players must enter a number between 0 and 7 (both inclusive) to specify the column in which he/she wants to drop his/her chip.
Author: Prithvijit Chakrabarty (prithvichakra@gmail.com)*/
package projectjava;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@PCJohn
PCJohn / ServoScan.ino
Last active Sep 19, 2018
A processing and arduino sketch for 3D mapping with an ultrasonic sensor
View ServoScan.ino
/*
Arduino program to control a ultrasonic 3-D mapping sensor.
The programs controls an HC-SR04 ultrasonic sensor connected to the Arduino board.
A collaborating Processing sketch interacts with this program with serial communication to control the angle
Authors:Prithvijit Chakrabarty (prithvichakra@gmail.com)
Kartik S. Lovekar (kslovekar@gmail.com)
*/
#include <Servo.h>
#include <NewPing.h>
@PCJohn
PCJohn / AudioPlayer.java
Last active Sep 17, 2015
Processing sketch for a music player
View AudioPlayer.java
/*
A Processing sketch for an audio player with frequency visualization.
Authors: Prithvijit Chakrabarty (prithvichakra@gmail.com)
Kartik Lovekar (kslovekar@gmail.com)
*/
import ddf.minim.*;
import java.io.*;
import java.util.*;
You can’t perform that action at this time.