Skip to content

Instantly share code, notes, and snippets.

View shravankumar147's full-sized avatar
🎯
Focusing

Shravankumar shravankumar147

🎯
Focusing
View GitHub Profile
@33eyes
33eyes / commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
Last active March 25, 2024 20:08
How to commit jupyter notebooks without output to git while keeping the notebooks outputs intact locally
  1. Add a filter to git config by running the following command in bash inside the repo:
git config filter.strip-notebook-output.clean 'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR'  
  1. Create a .gitattributes file inside the directory with the notebooks

  2. Add the following to that file:

*.ipynb filter=strip-notebook-output  
http://nadbordrozd.github.io/blog/2016/05/20/text-classification-with-word2vec/
https://blog.keras.io/using-pre-trained-word-embeddings-in-a-keras-model.html
https://stackoverflow.com/questions/31321209/doc2vec-how-to-get-document-vectors
http://linanqiu.github.io/2015/10/07/word2vec-sentiment/
https://rare-technologies.com/doc2vec-tutorial/
https://radimrehurek.com/gensim/models/doc2vec.html#gensim.models.doc2vec.TaggedDocument
https://www.kaggle.com/tj2552/sentiment-classification-in-5-classes-doc2vec
https://github.com/ibrahimsharaf/Doc2vec
@machinelearning147
machinelearning147 / build_face_dataset.py
Created June 16, 2018 18:26
build_face_dataset using webcam
# USAGE
# python build_face_dataset.py --cascade haarcascade_frontalface_default.xml --output dataset/adrian
# import the necessary packages
from imutils.video import VideoStream
import argparse
import imutils
import time
import cv2
import os
@shravankumar147
shravankumar147 / face_detection.py
Last active September 1, 2022 09:27
Face Detection using dlib and opencv. It detects even multi-faces.
# USAGE
# python face_detection.py --image face1.jpg
# import the necessary packages
# from imutils import face_utils
# import numpy as np
import argparse
import imutils
import dlib
import cv2
@fchollet
fchollet / classifier_from_little_data_script_1.py
Last active November 28, 2023 07:12
Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@vinhkhuc
vinhkhuc / simple_mlp_tensorflow.py
Last active December 22, 2021 11:52
Simple Feedforward Neural Network using TensorFlow
# Implementation of a simple MLP network with one hidden layer. Tested on the iris data set.
# Requires: numpy, sklearn>=0.18.1, tensorflow>=1.0
# NOTE: In order to make the code simple, we rewrite x * W_1 + b_1 = x' * W_1'
# where x' = [x | 1] and W_1' is the matrix W_1 appended with a new row with elements b_1's.
# Similarly, for h * W_2 + b_2
import tensorflow as tf
import numpy as np
from sklearn import datasets
from sklearn.model_selection import train_test_split
@pannous
pannous / tensorflow_xor_hello_world.py
Created November 11, 2015 14:33
A simple neural network learning the XOR function with the tensorflow framework
#!/usr/bin/env PYTHONIOENCODING="utf-8" python
"""
A simple neural network learning the XOR function
"""
import tensorflow as tf
sess = tf.InteractiveSession()
# Desired input output mapping of XOR function:
x_ = [[0, 0], [0, 1], [1, 0], [1, 1]] # input
#labels=[0, 1, 1, 0] # output =>

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!

@JosefJezek
JosefJezek / how-to-use-pelican.md
Last active November 11, 2023 06:51
How to use Pelican on GitHub Pages
@garydoranjr
garydoranjr / quadprog.py
Created February 21, 2012 20:35
MATLAB style quadprog from CVXOPT qp
from cvxopt import matrix as cvxmat, sparse, spmatrix
from cvxopt.solvers import qp, options
import numpy as np
def quadprog(H, f, Aeq, beq, lb, ub):
"""
minimize:
(1/2)*x'*H*x + f'*x
subject to:
Aeq*x = beq