Skip to content

Instantly share code, notes, and snippets.

View ClaudeCoulombe's full-sized avatar

Claude COULOMBE ClaudeCoulombe

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ClaudeCoulombe
ClaudeCoulombe / semantic_transfer_learning.py
Created May 22, 2018 20:30 — forked from prats226/semantic_transfer_learning.py
Sentiment classification using transfer learning
import collections, math, random, numpy
import tensorflow as tf
from sklearn.cross_validation import train_test_split
sentences = """hated the movie it was stupid;\ni hated it so boring;\nawesome the movie was inspiring;\nhated it what a disaster;\nwe hated the movie they were idiotic;\nhe was stupid, hated her;\nstupid movie is boring;\ninspiring ourselves, awesome;\ninspiring me, brilliant;\nwe hated it they were rubbish;\nany inspiring movie is amazing;\nit was stupid what a disaster;\nits stupid, rubbish;\nstupid, idiotic!;\nawesome great movie;\nboring, must be hated;\nhe was boring the movie was stupid;\nboring movie was a disaster;\nboth boring and rubbish;\nso boring and idiotic;\ngreat to amazing;\ndisaster, more than hated;\nbetween disaster and stupid;\ndisaster, so boring;\nawesome movie, brilliant;\ntoo awesome she was amazing;\nhe was brilliant loved it;\ndisaster, only idiotic;\nrubbish movie hated him;\nit was rubbish, why so stupid?;\nrubbish, too boring;\nrubbish, disaster!;\nrubbish, very
@ClaudeCoulombe
ClaudeCoulombe / CATCH_Keras_RL.md
Created February 5, 2018 05:58 — forked from EderSantana/CATCH_Keras_RL.md
Keras plays catch - a single file Reinforcement Learning example
@ClaudeCoulombe
ClaudeCoulombe / gist:da1e1de3c0a25c41ab3a95000ca149b1
Last active July 8, 2020 19:37
TensorFlow code for the Medium blog post «The revenge of Perceptron!»
# 6.1 Example: Learning XOR - GBC Book - Chapter 6 - pp. 166 to 171
# Some parts are inspired by the blog post
# Solving XOR with a Neural Network in TensorFlow
# by Stephen OMAN
# https://github.com/StephenOman/TensorFlowExamples/blob/master/xor%20nn/xor_nn.py
# Activation RELU + sigmoid for binary classification output + MSE loss function
# In order to ensure compatibility with TensorFlow 2
# import tensorflow as tf
import tensorflow.compat.v1 as tf
Epoch: 0
y_estimated:
[ 0.49961096]
[ 0.9245432]
[ 0.50023597]
[ 0.91048223]
W:
[-0.41441455 -0.10702395]
[-1.52169275 1.46376789]
c: