Skip to content

Instantly share code, notes, and snippets.

View gaurav-singh1998's full-sized avatar
🎯
Focusing

Gaurav Singh gaurav-singh1998

🎯
Focusing
  • Mumbai, India
View GitHub Profile
@gaurav-singh1998
gaurav-singh1998 / nes.py
Created March 4, 2020 15:07 — forked from karpathy/nes.py
Natural Evolution Strategies (NES) toy example that optimizes a quadratic function
"""
A bare bones examples of optimizing a black-box function (f) using
Natural Evolution Strategies (NES), where the parameter distribution is a
gaussian of fixed standard deviation.
"""
import numpy as np
np.random.seed(0)
# the function we want to optimize
@gaurav-singh1998
gaurav-singh1998 / irc.md
Created February 18, 2020 11:28 — forked from xero/irc.md
irc cheat sheet

#IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

##The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
@gaurav-singh1998
gaurav-singh1998 / coomatrix.py
Created March 16, 2019 16:30
Gist to calculate the cooccurence matrix
def co_occurence_matrix(list_of_words, preprocessed_reviews, window_size=5):
'''
Function which takes list of words and preprocessed_reviews as the inputs and
returns the co_occurence_matrix.
Args:
list_of_words: A list of words for which the co-occurence matrix is required.
preprocessed_reviews: A list of all the preprocessed reviews for which the co-occurence matrix is required.
window_size: Suitable window size for which the co-occurence matrix is required.
Returns:
cooc: The calculated co-occurence matrix.