Skip to content

Instantly share code, notes, and snippets.

View pratos's full-sized avatar
🎯
Focusing

prthamesh pratos

🎯
Focusing
View GitHub Profile
@pratos
pratos / gist:b32f6a780b462c68c18b6ed2b0a5f891
Created July 13, 2016 04:20 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
@pratos
pratos / jupyter_connect.md
Created April 4, 2017 05:14
Connect to remote Jupyter notebook

Starting notebook in remote

$ ssh remote_user@remote_host
$ cd <repository>
$ jupyter notebook --no-browser

Connecting to the remote notebook

ssh -N -f -L localhost:8888:localhost:8889 remote_user@remote_host
@pratos
pratos / time_manipulation_R.md
Last active April 4, 2017 05:24
To convert mixed date strings to standard date format
library(lubridate)
parse_date_time(x = paste("01-", "13-Jan", sep = ""),
+                 orders = c("d m y", "d-y-m", "m-d-y"),
+                 locale = "eng", tz="GMT")
[1] "2013-01-01 GMT"

parse_date_time(x = paste("01-", "Jan-13", sep = ""),
+                 orders = c("d m y", "d-y-m", "m-d-y"),
+                 locale = "eng", tz="GMT")
@pratos
pratos / gist:09312bd52b4660fb6a7441cd4f5059a7
Last active April 11, 2017 09:05
Regular functions in Ubuntu

Get list of the packages installed in the system

$ dpkg --list

Remove the packages from Ubuntu

sudo apt-get --purge remove <package-name>

@pratos
pratos / hingeloss.py
Created April 12, 2017 09:30
CS231n Hinge Loss SVM Snippet - Vectorized
import numpy as np
W = np.array([(0.01,-0.05,0.1,0.05),(0.7,0.2,0.05,0.16),(0.0,-0.45,-0.2, 0.03)]) #Weights
xi = np.array([-15,22,-44,56]) #Input
b = np.array([0.0,0.2,-0.3]) #Bias
delta = 1
y = np.sum((np.dot(W,xi),b), axis=0)
@pratos
pratos / softmax.py
Created April 12, 2017 09:42
CS231n Softmax (Cross-entropy loss) - Vectorized
import numpy as np
W = np.array([(0.01,-0.05,0.1,0.05),(0.7,0.2,0.05,0.16),(0.0,-0.45,-0.2, 0.03)]) #Weights
xi = np.array([-15,22,-44,56]) #Input
b = np.array([0.0,0.2,-0.3]) #Bias
delta = 1
y = np.sum((np.dot(W,xi),b), axis=0)
bleach==2.0.0
cycler==0.10.0
decorator==4.0.11
entrypoints==0.2.2
html5lib==0.999999999
ipykernel==4.6.1
ipython==6.0.0
ipython-genutils==0.2.0
ipywidgets==6.0.0
jedi==0.10.2
@pratos
pratos / Dockerfile
Last active April 24, 2017 20:47
'Docker for Data Science' blogpost
# Base image
FROM python:3.5.3-onbuild
# Updating repository sources
RUN apt-get update
# Installing cron and curl
RUN apt-get install cron -yqq \
curl
@pratos
pratos / machine_specs.txt
Last active April 26, 2017 07:36
'For blogpost' : Deep Learning machine setup
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
@pratos
pratos / success.txt
Created April 26, 2017 11:13
'Deep Learning Environment' blogpost
(dlgpu) user@user:~$ python
Python 3.5.3 |Continuum Analytics, Inc.| (default, Mar 6 2017, 11:58:13)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keras
Using TensorFlow backend.
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally