Skip to content

Instantly share code, notes, and snippets.

View svmihar's full-sized avatar
🙏

sumihar christian svmihar

🙏
View GitHub Profile
from typing import List
from pathlib import Path
import multiprocessing
from gensim.models.doc2vec import Doc2Vec, TaggedDocument
from gensim.models import Word2Vec
import argparse
from gensim.utils import simple_preprocess
from datetime import datetime
from tqdm import tqdm
logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',
datefmt='%m/%d/%Y %H:%M:%S',
level=logging.INFO)
logger = logging.getLogger(__name__)
@svmihar
svmihar / rabin-karp.py
Last active November 4, 2019 10:03
implementation of rabin karp pattern matching on alphabetical character
"""
avg O(m+n), worst O(m*n)
only returns the index of the first pattern occurrence.
so if you search 'a' in 'bdaba', it returns 2
"""
class RollingHash:
def __init__(self, text, sizeWord):
# Play an audio beep. Any audio URL will do.
from google.colab import output
output.eval_js('new Audio("https://upload.wikimedia.org/wikipedia/commons/0/05/Beep-09.ogg").play()')
apt-get install tmux && pip install jupyter lab && \
tmux && \
jupyter lab --ip 0.0.0.0 --port 56784
@svmihar
svmihar / install-conda.sh
Created September 9, 2019 17:55 — forked from lneeraj97/install-conda.sh
Install Miniconda in Ubuntu
# Setup Ubuntu
sudo apt update --yes
sudo apt upgrade --yes
# Get Miniconda and make it the main Python interpreter
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p ~/miniconda
rm ~/miniconda.sh
export PATH=~/miniconda/bin:$PATH
@svmihar
svmihar / revert.md
Created August 21, 2019 12:18
reverting to multiple commits
@svmihar
svmihar / transfer_learning.md
Last active August 18, 2019 06:15
Few transfer learning papers with some footnotes.

Transfer Learning Papers

what is transfer learning

  • what is transfer learning

    transfer learning is the process of training a model on a large-scale dataset and then using that pretrained model to conduct learning for another downstream task (i.e., target task).

  • Deep-Learning-Adaptive-Computation-Machine

    Transfer learning and domain adaptation refer to the situation where what has been learned in one setting … is exploited to improve generalization in another setting

  • Handbook of Research on Machine Learning Applications, 2009. >Transfer learning is the improvement of learning in a new task through the transfer of knowledge from a rela

#!/usr/bin/env python
""" author: svmihar
problem source: https://www.youtube.com/watch?v=W2Nz3733mCw&lc=z222zbry0m3ogrpj404t1aokg0k1ngnhw55naycpr2chbk0h00410.1565984354643611
"""
# problem1
# adder(5)(3) --> 8
def adder(x):
def wrapper(y):
return x+y
@svmihar
svmihar / GitCommitEmoji.md
Created August 11, 2019 21:42 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji