Skip to content

Instantly share code, notes, and snippets.

View AndreFCruz's full-sized avatar
๐Ÿ’ป
Meeting deadlines

Andrรฉ Cruz AndreFCruz

๐Ÿ’ป
Meeting deadlines
View GitHub Profile
@W4ngatang
W4ngatang / download_glue_data.py
Last active October 21, 2025 02:22
Script for downloading data of the GLUE benchmark (gluebenchmark.com)
''' Script for downloading all GLUE data.
Note: for legal reasons, we are unable to host MRPC.
You can either use the version hosted by the SentEval team, which is already tokenized,
or you can download the original data from (https://download.microsoft.com/download/D/4/6/D46FF87A-F6B9-4252-AA8B-3604ED519838/MSRParaphraseCorpus.msi) and extract the data from it manually.
For Windows users, you can run the .msi file. For Mac and Linux users, consider an external library such as 'cabextract' (see below for an example).
You should then rename and place specific files in a folder (see below for an example).
mkdir MRPC
cabextract MSRParaphraseCorpus.msi -d MRPC
@AndreFCruz
AndreFCruz / TicTacToe.py
Created September 15, 2017 21:43
TicTacToe - MiniMax AI based on a scoring matrix of the game tree
'''
TicTacToe Game
Console based.
MiniMax AI based on a scoring matrix of the game tree
Python 2.7.9 - 32 bit
@author Andre Cruz
'''
@ashishraste
ashishraste / xkcd-plots.md
Last active March 21, 2024 16:29
Steps to plot xkcd-style graphs using Matplotlib and Python

System details : Ubuntu 14.04, python-2.7.


  1. Download Humor-Sans ttf font from here.
  2. Place it in /usr/share/fonts/truetype/. For OSx systems, you'd just need to double-click the font file to install.
  3. Run the following commands, to refresh your system's font cache and to delete Maplotlib's font cache.
 sudo fc-cache -f -v
 cd ~/.cache/matplotlib; rm fontList.cache; cd #for OSx systems, this file resides in ~/.matplotlib/
@cbaziotis
cbaziotis / AttentionWithContext.py
Last active April 25, 2022 14:37
Keras Layer that implements an Attention mechanism, with a context/query vector, for temporal data. Supports Masking. Follows the work of Yang et al. [https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf] "Hierarchical Attention Networks for Document Classification"
def dot_product(x, kernel):
"""
Wrapper for dot product operation, in order to be compatible with both
Theano and Tensorflow
Args:
x (): input
kernel (): weights
Returns:
"""
if K.backend() == 'tensorflow':
@antonioalmeida
antonioalmeida / init.lua
Last active December 15, 2016 16:34
My Hammerspoon's config file
-- Hammerspoon configuration, heavily influenced by sdegutis default configuration
-- init grid
hs.grid.MARGINX = 0
hs.grid.MARGINY = 0
hs.grid.GRIDWIDTH = 8
hs.grid.GRIDHEIGHT = 4
-- disable animation
hs.window.animationDuration = 0
@mbollmann
mbollmann / attention_lstm.py
Last active August 22, 2024 07:06
My attempt at creating an LSTM with attention in Keras
class AttentionLSTM(LSTM):
"""LSTM with attention mechanism
This is an LSTM incorporating an attention mechanism into its hidden states.
Currently, the context vector calculated from the attended vector is fed
into the model's internal states, closely following the model by Xu et al.
(2016, Sec. 3.1.2), using a soft attention model following
Bahdanau et al. (2014).
The layer expects two inputs instead of the usual one:
@karpathy
karpathy / min-char-rnn.py
Last active December 26, 2025 21:02
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@Jaza
Jaza / Private-pypi-howto
Last active July 2, 2023 16:24
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@rxaviers
rxaviers / gist:7360908
Last active December 29, 2025 05:57
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@joyrexus
joyrexus / README.md
Last active December 21, 2025 15:33 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})