About
TensorFlow
TensorFlow™ is an open source software TensorFlow™ is an open source software
library for numerical computation using
data flow graphs. TensorFlow was
originally developed for the purposes of
conducting machine learning and deep
neural networks research, but the system
is general enough to be applicable in a
wide variety of other domains as well.wide variety of other domains as well.
Skflow
Scikit Flow provides a set of high level
model classes that you can use to easily
integrate with your existing Scikit-learn
pipeline code. Scikit Flow is a simplified
interface for TensorFlow, to get people
started on predictive analytics and data
mining. Scikit Flow has been merged into
TensorFlow since version 0.8 and now TensorFlow since version 0.8 and now
called TensorFlow Learn.
Keras
Keras is a minimalist, highly modular
neural networks library, written in Python
and capable of running on top of either
TensorFlow or Theano
Installation
How to install new package in Python:
pip install <package-name>
Example: pip install requests
How to install tensorflow?
device = cpu/gpu
python_version = cp27/cp34
sudo pip install sudo pip install
https://storage.googleapis.com/
tensorflow/linux/$device/tensorflow-
0.8.0-$python_version-none-linux_x86
_64.whl
How to install Skflow
pip install sklearn
How to install KerasHow to install Keras
pip install keras
update ~/.keras/keras.json - replace
“theano” by “tensorflow”
Helpers
Python helper
Important functions
type(object)type(object)
Get object type
help(object)
Get help for object (list of available
methods, attributes, signatures and so on)
dir(object)
Get list of object attributes
(fields, functions)(fields, functions)
str(object)
Transform an object to string
object?
Shows documentations about the object
globals()
Return the dictionary containing the Return the dictionary containing the
current scope's global variables.
locals()
Update and return a dictionary containing
the current scope's local variables.
id(object)
Return the identity of an object. This is
guaranteed to be unique among
simultaneously existing objects.
import __builtin__
dir(__builtin__)
Other built-in functions Other built-in functions
TensorFlow
Main classes
tf.Graph()
tf.Operation()
tf.Tensor()
tf.Session()
Some useful functionsSome useful functions
tf.get_default_session()
tf.get_default_graph()
tf.reset_default_graph()
ops.reset_default_graph()
tf.device(“/cpu:0”)
tf.name_scope(value)
tf.convert_to_tensor(value)tf.convert_to_tensor(value)
TensorFlow Optimizers
GradientDescentOptimizer
AdadeltaOptimizer
AdagradOptimizer
MomentumOptimizer
AdamOptimizer
FtrlOptimizerFtrlOptimizer
RMSPropOptimizer
Reduction
reduce_sum
reduce_prod
reduce_min
reduce_max
reduce_meanreduce_mean
reduce_all
reduce_any
accumulate_n
Activation functions
tf.nn?
relu
relu6relu6
elu
softplus
softsign
dropout
bias_add
sigmoid
tanhtanh
sigmoid_cross_entropy_with_logits
softmax
log_softmax
softmax_cross_entropy_with_logits
sparse_softmax_cross_entropy_with_logits
weighted_cross_entropy_with_logits
etc.etc.
Skflow
Main classes
TensorFlowClassifier
TensorFlowRegressor
TensorFlowDNNClassifier
TensorFlowDNNRegressor
TensorFlowLinearClassifierTensorFlowLinearClassifier
TensorFlowLinearRegressor
TensorFlowRNNClassifier
TensorFlowRNNRegressor
Version 1.09
Get the latest version at:
TensorFlow Cheat Sheet
评论0
最新资源