Skip to content

Instantly share code, notes, and snippets.

View prerakmody's full-sized avatar
🏠
Working from home

pmod prerakmody

🏠
Working from home
View GitHub Profile
@prerakmody
prerakmody / cluster.m
Last active December 26, 2018 15:10
PRTOOLS
% Loading data points
data = hall;
scatterd(hall); % 14 clusers || 3 clusters
o2c = interactclust(data,'a');
@prerakmody
prerakmody / genius.md
Last active September 19, 2018 17:16
Interactive Intelligence

Check JAVA

  • sudo apt update
  • sudo ap install default-jre
  • java -showversion (make sure its version > 1.8)

Download Genius

  • Download genius
  • java -jar <>.jar

Genius

@prerakmody
prerakmody / 3dcnn.py
Last active September 11, 2020 17:11
PyTorch Hacks
import torch
import torchsummary
torch.set_default_tensor_type(torch.FloatTensor)
from pynvml import *
try: nvmlInit()
except:pass
class VoxelNetFeat(torch.nn.Module):
@prerakmody
prerakmody / grid.py
Last active September 10, 2020 17:49
Numpy Image Hacks
"""
Creating a spherical gaussian heatmap
- in 2D
- in 3D
"""
import pdb
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
@prerakmody
prerakmody / Pseduo - Code
Last active February 23, 2022 21:00
Latex Hacks
\usepackage[]{algorithm2e}
\RestyleAlgo{boxruled}
\LinesNumbered
\begin{algorithm}[H]
\caption{Lawler's pseudo-polynomial algorithm}
\SetAlgoLined
\KwData{S(i,j,k) with S sorted by due-date}
\KwResult{integer representing the minimum tardiness of a schedule S}
@prerakmody
prerakmody / install.md
Last active June 9, 2019 12:24
Jupyter Notebook Hacks

Fresh Install

  • pip install jupyter

Check Installations

  • pip freeze | grep jupyter
  • pip freeze | grep ipy
  • pip freeze | grep notebook

Notes

  • To upgrade any specific package : pip install --upgrade
@prerakmody
prerakmody / bar.m
Last active November 10, 2020 09:40
MATLAB Hacks
\newcommand*\xbar[1]{%
\hbox{%
\vbox{%
\hrule height 0.5pt % The actual bar
\kern0.5ex% % Distance between bar and symbol
\hbox{%
\kern-0.1em% % Shortening on the left side
\ensuremath{#1}%
\kern-0.1em% % Shortening on the right side
}%
@prerakmody
prerakmody / pandas_hacks.py
Last active June 26, 2019 13:05
Pandas Hacks
import pdb; #pdb.set_trace()
import pandas as pd
from IPython.display import display
# 1. Kick Off
df = pd.read_csv('myfile.csv')
print (df.head())
print (df.head(n=10))
print (df.columns)
col_Y = ''
from sklearn import metrics
from sklearn import preprocessing
from sklearn.preprocessing import normalize
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
from sklearn.model_selection import StratifiedKFold
from imblearn.over_sampling import SMOTE
from sklearn.svm import SVC
@prerakmody
prerakmody / check_gpu_usage.py
Last active February 15, 2022 06:56
Google Colab Hacks
# memory footprint support libraries/code
# ! ln -sf /opt/bin/nvidia-smi /usr/bin/nvidia-smi
# ! pip install humanize
# ! pip install jupyter_contrib_nbextensions
# ! jupyter contrib nbextension install --user
# ! jupyter nbextension enable codefolding/main
# ! jupyter nbextension enable hinterland/hinterland
import psutil