Skip to content

Instantly share code, notes, and snippets.

View pratos's full-sized avatar
🎯
Focusing

prthamesh pratos

🎯
Focusing
View GitHub Profile
@pratos
pratos / gcloud_docker_setup.md
Last active January 12, 2023 18:26
Installing gcloud on Ubuntu 16.04 LTS

Installing it using cURL

$ curl https://sdk.cloud.google.com | bash

When the first time you run the above statement, it might be that you'll get the following error if python2 is not installed in your system.

Welcome to the Google Cloud SDK!
Traceback (most recent call last):
  File "/home/pratos/google-cloud-sdk/lib/third_party/enum/__init__.py", line 364, in __getattr__
@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 / 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 / deviceQuery_out.txt
Created April 26, 2017 09:52
'Deep Learning environment' Blogpost
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GeForce GTX 1060 6GB"
CUDA Driver Version / Runtime Version 8.0 / 8.0
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory: 6073 MBytes (6367739904 bytes)
@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
@pratos
pratos / commands.md
Created May 5, 2017 14:40
Google Cloud Platform Commands
  • Command to authenticate glcoud

    • gcloud auth login
  • Command to chose an existing project

    • gcloud project list
    • gcloud config set core/project <project-name>
  • Command to create and choose a new project *