Skip to content

Instantly share code, notes, and snippets.

View mpgxc's full-sized avatar
☢️
always learning...

mpgxc mpgxc

☢️
always learning...
View GitHub Profile
@jordanspooner
jordanspooner / bilstm.py
Last active May 23, 2024 06:11
BiLSTM Architecture
#=================================
# Sentence-level QE -- BiRNN model
#=================================
#
## Inputs:
# 1. Sentences in src language (shape: (mini_batch_size, line_words))
# 2. Parallel machine-translated documents (shape: (mini_batch_size, line_words))
#
## Output:
# 1. Sentence quality scores (shape: (mini_batch_size,))
@guilhermebkel
guilhermebkel / 📊 Weekly development breakdown
Last active March 14, 2021 00:00
Weekly Development Stats
TypeScript 25 hrs 24 mins ████████████████▋░░░░ 79.7%
JavaScript 2 hrs 45 mins █▊░░░░░░░░░░░░░░░░░░░ 8.7%
Docker 1 hr 28 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.6%
Markdown 36 mins ▍░░░░░░░░░░░░░░░░░░░░ 1.9%
Other 36 mins ▍░░░░░░░░░░░░░░░░░░░░ 1.9%
@srafay
srafay / generate-request-form-data.py
Created January 16, 2019 05:18
Python Request for form-data
# Generates request data payload to be sent as 'form-data'
REQUEST_FORM_DATA_BOUNDARY = "REQUEST_FORM_DATA_BOUNDARY"
FORM_DATA_STARTING_PAYLOAD = '--{0}\r\nContent-Disposition: form-data; name=\\"'.format(REQUEST_FORM_DATA_BOUNDARY)
FORM_DATA_MIDDLE_PAYLOAD = '\"\r\n\r\n'
FORM_DATA_ENDING_PAYLOAD = '--{0}--'.format(REQUEST_FORM_DATA_BOUNDARY)
REQUEST_CUSTOM_HEADER = {
'content-type': "multipart/form-data; boundary={}".format(REQUEST_FORM_DATA_BOUNDARY),
'Content-Type': "",
'cache-control': "no-cache"
import requests
from bs4 import BeautifulSoup
headers = {
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'
}
login_data = {
'name': '<username>',
'pass': '<password>',
@whyboris
whyboris / matplotlib.py
Last active May 12, 2021 02:47
Keras Loss & Accuracy Plot Helper Function
import matplotlib.pyplot as plt
# Plot model history more easily
# when plotting, smooth out the points by some factor (0.5 = rough, 0.99 = smooth)
# method taken from `Deep Learning with Python` by François Chollet
def smooth_curve(points, factor=0.75):
smoothed_points = []
for point in points:
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active July 27, 2024 14:45
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joelouismarino
joelouismarino / googlenet.py
Last active October 9, 2023 07:09
GoogLeNet in Keras
from __future__ import print_function
import imageio
from PIL import Image
import numpy as np
import keras
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Dropout, Flatten, Concatenate, Reshape, Activation
from keras.models import Model
from keras.regularizers import l2
from keras.optimizers import SGD
@rdeavila
rdeavila / git-update-fork.sh
Last active June 28, 2024 13:53
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream