- Powered by Python
a beautiful, highly flexible and generic biologically-inspired programming paradigm which enables a computer to learn from observational data
model = Word2Vec(sentences, size=100, window=5, min_count=5, workers=4)
model.save(fname)
model = Word2Vec.load(fname) # you can continue training with the loaded model!
model.most_similar(positive=['woman', 'king'], negative=['man'])
==> [('queen', 0.50882536), ...]
model.doesnt_match("breakfast cereal dinner lunch".split())
==> 'cereal'
model.similarity('woman', 'man')
==> 0.73723527
model['computer'] # raw numpy vector of a word
==> array([-0.00449447, -0.00310097, 0.02421786, ...], dtype=float32)
Theano is a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently.
import numpy
import theano
import theano.tensor as T
from theano import pp
x = T.dscalar('x')
y = x ** 2
gy = T.grad(y, x)
f = theano.function([x], gy)
f(4)
# array(8.0)
Probability of a sentence consisting of 'm' words
=
Multiplication of Joint probability of each word conditioned upon (all) previous words
Email: rishy.s13@gmail.com
Github: https://github.com/rishy
Linkedin: https://www.linkedin.com/in/rishabhshukla1