Skip to content

Margus Roo –

If you're inventing and pioneering, you have to be willing to be misunderstood for long periods of time

  • Cloudbreak Autoscale fix
  • Endast

Simple Tensorflow arithmetic

Posted on November 10, 2017 - November 10, 2017 by margusja

Lets imagine we have to do a simple arithmetic: (10+20) * (30-40)

In some unclear reason we decidet to use Tensorflow.

Default language is there python.

(tensorflow) margusja@IRack:~/tensorflow/tensorflow_scripts$ python
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 13:19:00)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import tensorflow as tf
/Users/margusja/tensorflow/lib/python3.6/importlib/_bootstrap.py:205: RuntimeWarning: compiletime version 3.5 of module ‘tensorflow.python.framework.fast_tensor_util’ does not match runtime version 3.6
return f(*args, **kwds)
>>>
>>> a = tf.constant(10)
>>> b = tf.constant(20)
>>> c = tf.constant(30)
>>> d = tf.constant(40)
>>> e = tf.add(a,b)
>>> f = tf.subtract(c,d)
>>> h = tf.multiply(e,f)
>>> sess = tf.Session()
2017-11-10 19:02:43.777454: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
>>> print(sess.run(h))
-300

We can explore graph in tensorbar:

 

Posted in LinuxTagged tensorflow

Post navigation

my vim tips
OpenCP cv:Mat and cv:transpose

The Master

Categories

  • Apache
  • Apple
  • Assembler
  • Audi
  • BigData
  • BMW
  • C
  • Elektroonika
  • Fun
  • Hadoop
  • help
  • Infotehnoloogia koolis
  • IOT
  • IT
  • IT eetilised
  • Java
  • Langevarjundus
  • Lapsed
  • lastekodu
  • Linux
  • M-401
  • Mac
  • Machine Learning
  • Matemaatika
  • Math
  • MSP430
  • Muusika
  • neo4j
  • openCL
  • Õpetaja identiteet ja tegevusvõimekus
  • oracle
  • PHP
  • PostgreSql
  • ProM
  • R
  • Turvalisus
  • Varia
  • Windows
Proudly powered by WordPress | Theme: micro, developed by DevriX.