- to be run sequentially
| description | command |
|---|---|
| run python script | python xx.py |
| run the following command : this pauses the process | CTRL + Z ( this works for ubuntu server) |
| put the process in background | bg |
| This document is about running jupyter notebook on a server and accessing it on a local machine. | |
| On the remote machine, start jupyter notebook | |
| remote_user@remote_host$ ipython notebook --no-browser --port=8889 | |
| when the notebook will start, it will generate a token. | |
| On the local machine, start SSH tunnel |
| This document shows step by step procedure on how to SSH without using password everytime | |
| Type the following commands: | |
| 1. cd .ssh | |
| 2. vim config | |
| when you open config file, type the following: | |
| host snake |
| set nu | |
| set nocompatible " required | |
| filetype off " required | |
| " set the runtime path to include Vundle and initialize | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| " alternatively, pass a path where Vundle should install plugins | |
| "call vundle#begin('~/some/path/here') |
| import numpy as np | |
| def pf(output,target,metric=None): | |
| TP = np.count_nonzero(data*target) | |
| TN = np.count_nonzero((data - 1) * (target - 1)) | |
| FP = np.count_nonzero(data * (target - 1)) | |
| FN = np.count_nonzero((data - 1) * target) | |
| precision = TP / (TP + FP) | |
| recall = TP / (TP + FN) | |
| F1 = 2 * precision * recall / (precision + recall) | |
| accuracy = (TP+TN)/(TP+TN+FP+FN) |
| import torch | |
| def pf1(output,target,metric=None): | |
| d = output.data | |
| t = target.data | |
| TP = torch.nonzero(d*t).size(0) | |
| TN = torch.nonzero((d - 1) * (t - 1)).size(0) | |
| FP = torch.nonzero(d * (t - 1)).size(0) | |
| FN = torch.nonzero((d - 1) * t).size(0) | |
| precision = TP / (TP + FP) | |
| recall = TP / (TP + FN) |
| import torch | |
| from torch import nn | |
| class autoencoder(nn.Module): | |
| def __init__(self,downsizing_factor=None,in_channels=1): | |
| self.downsize = downsizing_factor | |
| self.in_channels = in_channels | |
| super(autoencoder,self).__init__() | |
| conv_modules=[] | |
| self.in_channels = self.in_channels |
| import torch | |
| from torch import nn | |
| class autoencoder(nn.Module): | |
| def __init__(self,downsizing_factor=None,in_channels=1): | |
| self.downsize = downsizing_factor | |
| self.in_channels = in_channels | |
| super(autoencoder,self).__init__() | |
| conv_modules=[] | |
| self.in_channels = self.in_channels |
| set tabstop=8 | |
| set expandtab | |
| set softtabstop=4 | |
| set shiftwidth=4 | |
| filetype plugin indent on | |
| set number | |
| set backspace=indent,start | |
| set hlsearch |
| # Use C-o like we do in screen as action key | |
| #unbind C-b | |
| set -g prefix C-a | |
| #bind-key C-b last-window | |
| bind-key a send-prefix | |
| bind-key C-n next-window | |
| bind-key C-p previous-window | |
| # Terminal emulator window title | |
| set -g set-titles on |