TensorFlow
TensorFlow
Concepts
- Data
- reading
- preprocessing
- Model
- creation
- Training
- Evaluation
Logistic Regression
uses a linear weighted combination of features and generates the probability of predicting different classes
The softmax function takes an un-normalized vector, and normalizes it into a probability distribution.
binary classification task: num_output_classes = 2
Install
pip3 install tensorflow
Test
#!/usr/bin/env python3
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
a = tf.constant(10)
b = tf.constant(32)
print(sess.run(a+b))
Verify
import tensorflow as tf
tf.enable_eager_execution()
tf.add(1,2)
hello = tf.constant('Hello, TensorFlow!')
Named Entity Recognition/Sequence Tagging
John lives in New York and works for the European Union
B-PER O O B-LOC I-LOC O O O O B-ORG I-ORG
MNIST
Softmax Regression
A softmax regression has 2 steps:
- add up the evidence of input being in certain classes
- then convert that evidence into probabilities
References
- https://guillaumegenthial.github.io/sequence-tagging-with-tensorflow.html
- http://karpathy.github.io/
- http://web.stanford.edu/class/cs224n/
- https://opennlp.apache.org/docs/1.9.0/manual/opennlp.html