Skip to content

Instantly share code, notes, and snippets.

View victor-iyi's full-sized avatar
🎯
Focusing

Victor I. Afolabi victor-iyi

🎯
Focusing
View GitHub Profile
@victor-iyi
victor-iyi / neural-net-basics-01-03.py
Created November 12, 2017 20:15
Neural Network Basics: Part One (hyperparameters)
input_dim = X.shape[-1]
hidden_dim = 4
output_dim = y.shape[-1]
print('Input dimension: {}\nHidden dimension: {}\nOuput dimension: {}'.format(input_dim, hidden_dim, output_dim))
@victor-iyi
victor-iyi / neural-net-basics-01-02.py
Created November 12, 2017 20:07
Neural Network Basics: Part One (features & labels)
X = np.array([ [0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1] ])
y = np.array([ [0], [1], [1], [0] ])
@victor-iyi
victor-iyi / neural-net-basics-01-01.py
Created November 12, 2017 20:04
Neural Network Basics: Part one (dependencies)
# The only dependency required.
import numpy as np
@victor-iyi
victor-iyi / word2vec.py
Created November 4, 2017 00:45
Preprocessing class for textual dataset. Converts words to vector representations
"""
@author Victor I. Afolabi
A.I. Engineer & Software developer
javafolabi@gmail.com
Created on 28 October, 2017 @ 9:55 PM.
Copyright © 2017. Victor. All rights reserved.
"""
@victor-iyi
victor-iyi / dataset.py
Last active December 14, 2017 14:13
Dataset class for pre-processing images, text, word vectorization dataset
"""
@author Victor I. Afolabi
A.I. Engineer & Software developer
javafolabi@gmail.com
Created on 02 November, 2017 @ 11:24 PM.
Copyright © 2017. Victor. All rights reserved.
"""
import datetime as dt
@victor-iyi
victor-iyi / game_theory.py
Created October 6, 2017 09:40
Minimax and Maximin Algorithm in Game Theory
"""
@author Victor I. Afolabi
A.I. Engineer & Software developer
javafolabi@gmail.com
Created on 05 October, 2017 @ 03:35 PM.
Copyright © 2017. Victor. All rights reserved.
"""
@victor-iyi
victor-iyi / linear_model.py
Created September 13, 2017 12:57
LinearRegression with Gradient Descent Algorithm.
"""
@author Victor I. Afolabi
A.I. Engineer & Software developer
javafolabi@gmail.com
Created on 25 August, 2017 @ 8:15 PM.
Copyright © 2017. victor. All rights reserved.
"""
import numpy as np
@victor-iyi
victor-iyi / wordnet_dictionary.py
Created August 27, 2017 14:28
A WordNet dictionary.
from nltk.corpus import wordnet
class Dictionary:
def __init__(self, word):
Dictionary.word = word
@staticmethod
def definition():
syns = Dictionary.synsets()
@victor-iyi
victor-iyi / speech_recognition.py
Created August 27, 2017 14:24
Speech recognition algorithm. Audio Source: Microphone
#!/usr/bin/env python3
# NOTE: this example requires PyAudio because it uses the Microphone class
import speech_recognition as sr
# obtain audio from the microphone
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
@victor-iyi
victor-iyi / visualize_decision_tree.py
Created August 27, 2017 14:23
Decision trees visualization
from sklearn.datasets import load_iris
from sklearn import tree
import numpy as np
iris = load_iris()
features = iris.data
labels = iris.target