Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
learning everyday

Rishabh Agrahari pyaf

😎
learning everyday
View GitHub Profile
View preprocess_dockerfile
# Build an image that can do training and inference in SageMaker
# This is a Python 3 image that uses the nginx, gunicorn, flask stack
# for serving inferences in a stable way.
FROM ubuntu:18.04
MAINTAINER Amazon AI <sage-learner@amazon.com>
RUN apt-get -y update && apt-get install -y --no-install-recommends \
View Pycaret_Dockerfile
FROM sklearn-base:0.23-1-cpu-py3
ENV SAGEMAKER_SKLEARN_VERSION 0.23-1
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true
COPY requirements.txt /requirements.txt
RUN python -m pip install -r /requirements.txt && \
rm /requirements.txt
COPY dist/sagemaker_sklearn_container-2.0-py3-none-any.whl /sagemaker_sklearn_container-2.0-py3-none-any.whl
@pyaf
pyaf / tf-gpu.sh
Created Jun 9, 2021
TF 2.4 GPU Conda Setup
View tf-gpu.sh
#!/bin/bash
# Initialize conda environment
echo 'Create Conda env? Type y or n and then press [ENTER]:'
read create_env
if [ $create_env = "y" ];
then
echo "Provide name for Conda virtualenv and then press [ENTER]:"
read env_name
@pyaf
pyaf / gpu
Last active Jun 28, 2020
Bash script for GPU usage and utilization monitoring in i3status bar.
View gpu
#!/bin/bash
output=$(nvidia-smi --format=csv,noheader --query-gpu=name,power.draw,fan.speed,utilization.gpu,temperature.gpu,memory.used,memory.total)
IFS=',' read -r -a array <<< "$output"
name=${array[0]}
power=${array[1]}
fan=${array[2]}
util=${array[3]}
@pyaf
pyaf / init.vim
Last active Mar 8, 2021
My neovim config file
View init.vim
let mapleader =","
call plug#begin('~/.config/nvim/plugged')
Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdtree'
Plug 'mboughaba/i3config.vim'
Plug 'jreybert/vimagit'
Plug 'LukeSmithxyz/vimling'
Plug 'PotatoesMaster/i3-vim-syntax'
Plug 'vimwiki/vimwiki'
View .tmux.conf
set-option -g status-style bg=colour235 #base02
set-option -g status-style fg=colour136 #yellow
set-option -g status-style default
bind -n S-Right next-window
bind -n S-Left previous-window
# set window split
bind-key v split-window -h
bind-key b split-window
@pyaf
pyaf / configure_xorg.md
Last active Feb 24, 2019
Using only integrated graphics for display and Nvidia GPU for CUDA on Ubuntu 18.04.2
View configure_xorg.md

Steps to follow:

  1. Install suitable driver for your Nvidia GPU. Don't worry if nvidia-smi isn't working.
  2. Note the output of lspci | egrep 'VGA|3D', mine gives the following:
00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f02 (rev a1)
  1. Edit your /etc/X11/xorg.conf as follows
@pyaf
pyaf / sources.list
Created Dec 29, 2018 — forked from rohitrawat/sources.list
Ubuntu 16.04 Xenial default /etc/apt/sources.list
View sources.list
#deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
@pyaf
pyaf / .tmux.conf
Last active Jan 11, 2021
My tmux config file, for tmux 2.8. (It breaks for >2.8. See comments.)
View .tmux.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
bind -n S-Right next-window
bind -n S-Left previous-window
# set window split
bind-key v split-window -h
bind-key b split-window
@pyaf
pyaf / model.py
Created May 20, 2018
CNN model architecture
View model.py
def CNN_model():
model = Sequential()
model.add(Conv2D(32, (3, 3), input_shape=(124, 124, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(32, (3, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))