Skip to content

Instantly share code, notes, and snippets.

View AnirudhDagar's full-sized avatar
🎯
Focusing

Anirudh Dagar AnirudhDagar

🎯
Focusing
View GitHub Profile
@AnirudhDagar
AnirudhDagar / model_parallel.py
Last active June 3, 2019 11:04
Parallelize cgcnn model
from __future__ import print_function, division
import os
import json
import shutil
import torch
import torch.nn as nn
import torch.optim as optim
@AnirudhDagar
AnirudhDagar / gcn_utils.py
Last active March 25, 2019 14:52
gcn_utils citation data split
"""
It would be nice if someone can explain the code below commenting out the working.
Referenced from https://github.com/tkipf/gae/blob/master/gae/preprocessing.py#L32
"""
def mask_test_edges(adj):
# I am not very sure if understand the exact purpose of this function.
# Function to build test set with 10% positive links
# NOTE: Splits are randomized and results might slightly deviate from reported numbers in the paper.
# TODO: Clean up.
@AnirudhDagar
AnirudhDagar / shogun_install.sh
Last active February 4, 2019 15:31
This is a Shogun Manual Installation Shell script.
#Run this shell script at the place where you intend to build shogun.
git clone https://github.com/AnirudhDagar/shogun.git #Change this link to your fork.
cd shogun
git submodule update --init #This will clone the submodules like shogun-gpl,data etc..
mkdir build
cd build
#Change the Python directories below according to your setup.
cmake -DLICENSE_GPL_SHOGUN=ON -DCMAKE_BUILD_TYPE=release -DBUILD_META_EXAMPLES=ON -DENABLE_TESTING=ON -DPYTHON_INCLUDE_DIR=/Users/gollum/anaconda3/include/python3.7m -DPYTHON_LIBRARY=/Users/gollum/anaconda3/lib/python3.7/ -DPYTHON_PACKAGES_PATH=/Users/gollum/anaconda3/lib/python3.7/site-packages/ -DPYTHON_EXECUTABLE=/Users/gollum/anaconda3/bin/python3 -DINTERFACE_PYTHON=ON ..
make
sudo make install
////https://www.spoj.com/problems/JULKA/
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int t=10;
int size = 105;
while (t--)
{
////https://www.spoj.com/problems/JULKA/
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int t=10;
int size = 105;
while (t--)
{
@AnirudhDagar
AnirudhDagar / RelationClassifier.py
Created July 11, 2018 19:51
Temporal Relation Classifier using GCN embeddings initial model for IISc Mall Project
import argparse
import random
import tensorflow as tf
import numpy as np
import pickle
import logging
class TemporalClassifier:
@AnirudhDagar
AnirudhDagar / PreProcessTest.py
Last active June 5, 2020 17:26
Graph Adjacency List & Matrix. Dependency Tree for IISc MALL Project
"""
A general file for seeing various pre-processing results
dummy_whole_train/train/ea980120.1830.0456.tml #Smallest check file
"""
from __future__ import print_function
import sys
import os
import numpy
import argparse