Skip to content

Instantly share code, notes, and snippets.

View Manojbhat09's full-sized avatar

Manoj Bhat Manojbhat09

View GitHub Profile
@Manojbhat09
Manojbhat09 / dbscan_python.py
Created July 16, 2021 03:40
Pure python DBSCAN algorithm. For simple interview practice.
# machine learning 101: dbscan
# wonderful unsupervised clustering, fast and works efficiently
# checkout HDBSCAN for an even more beautiful algorithm
'''
How to write dbscan:
1. look into the probem of clustering
2. start by first sample
3. compute the distance, get the neighbors
4. if the neighs are more than min samples, store the nighbors and expand recursively, save to same cluster and return, keep visited to avoid cycles,
@Manojbhat09
Manojbhat09 / fast-nested-loop.py
Last active October 4, 2020 20:17
Multiple Nested loops:: Fast nested loop function to use with your data processing (with variable list input).
'''Intro
If you have "Multiple Nested loops" to operate on a list with O(n^k) complexity,
Save time complex on itermediate list operations by utilizing python map-reduce!
'''
import numpy as np
from itertools import product
import time
'''Proposed

Credits: Zuxin Liu https://github.com/liuzuxin

Ubuntu 18.04 Environment Configuration (from beginning to giving up)

1. Install Ubuntu

  • make sure that the /swap partition is twice larger than the computer memory.
  • 25GB is enough for root /.
  • The /boot partition should be use as 'EFI system partition'. 1GB is enough.
  • The / partition should be of 'primary' type. Others should be 'logical'.
@Manojbhat09
Manojbhat09 / Running-python-on-browser
Created August 11, 2020 09:45
Js replacement resources for Deep learning applications
Brython
Skulpt
PyPy.js
Transcrypt
Pyodide
Good Summary of current methods:
https://stackoverflow.com/questions/30155551/python-in-browser-how-to-choose-between-brython-pypy-js-skulpt-and-transcrypt
@bikcrum
bikcrum / Connect Google Colab+Drive with SSH.ipynb
Last active January 24, 2024 04:13
This is the way how can you connect google colab as well as google drive (mounted) using SSH. This is useful when you want to download data directly to your google drive specially for machine learning purpose. It can be easy to mount google drive and use files into for your code.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yptheangel
yptheangel / QuantizationDL4J.java
Last active October 20, 2020 14:38
Ways to optimize Deeplearning4j model, FP32 to FP16 Quantization
// Tip 1: Do not save the updater if you do not plan to continue training your model
// Set false for saveUpdater flag.
ModelSerializer.writeModel(model, modelFilename, false);
// Results: Model size drop almost 40%.
// Tip 2: Convert FP32 to FP16 floating point precision(Quantization), currently DL4J only supports float. {DOUBLE, FLOAT, HALF}
// Convert the parameters just as below:
model = model.convertDataType(DataType.HALF);
// Results: Model size drop by 50%, half of its original size. Accuracy did not drop.
@johnmcfarlane
johnmcfarlane / begin(C++).md
Last active April 7, 2024 00:54
Resources for C++ beginners
@versatran01
versatran01 / kitti_archives.txt
Last active March 10, 2023 06:11
kitti archives
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_calib.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0001/2011_09_26_drive_0001_sync.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0002/2011_09_26_drive_0002_sync.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0005/2011_09_26_drive_0005_sync.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0009/2011_09_26_drive_0009_sync.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0011/2011_09_26_drive_0011_sync.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0013/2011_09_26_drive_0013_sync.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0014/2011_09_26_drive_0014_sync.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_26_drive_0015/2011_09_26_drive_0015_sync.zip
https://s3.eu-central-1.amazonaws.com/avg-kitti/raw_data/2011_09_2
@goldsborough
goldsborough / install-gcc.sh
Last active April 12, 2024 07:35
Instructions for installing GCC >= 4.9 for PyTorch Extensions
# Instructions for installing GCC 4.9 on various platforms.
# The commands show instructions for GCC 4.9, but any higher version will also work!
# Ubuntu (https://askubuntu.com/questions/466651/how-do-i-use-the-latest-gcc-on-ubuntu/581497#581497)
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9