Skip to content

yuemingl/TensorFlow-Tutorials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a collection of examples for how to use and extend TensorFlow.

Deep learning materials

CNN

http://www.wildml.com/2015/11/understanding-convolutional-neural-networks-for-nlp/ http://cs231n.github.io/convolutional-networks/ http://xrds.acm.org/blog/2016/06/convolutional-neural-networks-cnns-illustrated-explanation/ https://ujjwalkarn.me/2016/08/11/intuitive-explanation-convnets/

RNN

http://karpathy.github.io/2015/05/21/rnn-effectiveness/

LSTM

http://colah.github.io/posts/2015-08-Understanding-LSTMs/

CUDA

https://devblogs.nvidia.com/parallelforall/easy-introduction-cuda-c-and-c/

People & Blog

https://twitter.com/dennybritz http://www.kentran.net/ http://eli.thegreenplace.net/ http://blog.dennybritz.com/

An advanced example

This example shows the use of the low level function tf.gradients() The definiton of function R=R(x,y) is taken from the example on this Wiki page. If you are interested in creating new Optimizers for Tensorflow you may want to continue reading this example.

import tensorflow as tf

# define symbolic variables
x = tf.placeholder("float") 
y = tf.placeholder("float")

# define a function R=R(x,y)
R = 0.127-(x*0.194/(y+0.194))

# The derivative of R with respect to y
Rdy = tf.gradients(R, y); 

# Launch a session for the default graph to comput dR/dy at (x,y)=(0.362, 0.556)
sess = tf.Session()
result = sess.run(Rdy, {x:0.362,y:0.556})
print result
#[0.12484978]

The above example actually is implemented in one of my project SymJava which provides symbolic-numeric computations with just-in-time (JIT) compilation.

public class Example0 {
	public static void main(String[] args) {
		Expr R = 0.127-(x*0.194/(y+0.194));
		Expr Rdy = R.diff(y);
		System.out.println(Rdy);
		//Just-In-Time compile the symbolic expression to native code
		BytecodeFunc func = JIT.compile(new Expr[]{x,y}, Rdy);
		System.out.println(func.apply(0.362, 0.556));
	}
}

About

Advanced examples for using Tensorflow

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages