Skip to content

Instantly share code, notes, and snippets.

View ejmejm's full-sized avatar
🎯
Focusing

Edan Meyer ejmejm

🎯
Focusing
View GitHub Profile
@ejmejm
ejmejm / pytorch_tips_yt_follow.ipynb
Created May 9, 2021 09:14
pytorch_tips_yt_follow.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nottrobin
nottrobin / working-directory.py
Created January 26, 2016 01:42
Change directory / working directory context processor for python
import os
from contextlib import contextmanager
@contextmanager
def working_directory(path):
"""
A context manager which changes the working directory to the given
path, and then changes it back to its previous value on exit.
Usage:
@bllchmbrs
bllchmbrs / tfpdf.py
Last active December 29, 2021 14:10
TF IDF Explained in Python Along with Scikit-Learn Implementation
from __future__ import division
import string
import math
tokenize = lambda doc: doc.lower().split(" ")
document_0 = "China has a strong economy that is growing at a rapid pace. However politically it differs greatly from the US Economy."
document_1 = "At last, China seems serious about confronting an endemic problem: domestic violence and corruption."
document_2 = "Japan's prime minister, Shinzo Abe, is working towards healing the economic turmoil in his own country for his view on the future of his people."
document_3 = "Vladimir Putin is working hard to fix the economy in Russia as the Ruble has tumbled."