Kernel: Python 3 (Anaconda 5)
Tensorflow on CoCalc
Make sure to use the Jupyter Kernel "Python 3 (Anaconda or Ubuntu)"
Say Hello to Tensorflow!
In [1]:
1.9.0
<module 'tensorflow' from '/ext/anaconda5/lib/python3.6/site-packages/tensorflow/__init__.py'>
In [2]:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-2-d42bbacf9517> in <module>()
1 # Import data
----> 2 mnist = input_data.read_data_sets(FLAGS.data_dir,
3 one_hot=True,
4 fake_data=FLAGS.fake_data)
5
NameError: name 'input_data' is not defined
In [0]:
In [3]:
b'Hello, TensorFlow!'
In [4]:
'3.6.5 | packaged by conda-forge | (default, Apr 6 2018, 13:39:56) \n[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]'
In [5]:
In [6]:
42
In [7]:
'3.6.5 | packaged by conda-forge | (default, Apr 6 2018, 13:39:56) \n[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]'
In [8]:
Visualization Function
In [9]:
In [0]:
Mandelbrot Set (from the Tutorial)
In [10]:
In [11]:
In [12]:
In [13]:
WARNING:tensorflow:From /ext/anaconda5/lib/python3.6/site-packages/tensorflow/python/util/tf_should_use.py:118: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use `tf.global_variables_initializer` instead.
In [14]:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-14-928785c5c96f> in <module>()
3
4 # Have we diverged with this new value?
----> 5 not_diverged = tf.complex_abs(zs_) < 4
6
7 # Operation to update the zs and the iteration count.
AttributeError: module 'tensorflow' has no attribute 'complex_abs'
In [15]:
CPU times: user 2 µs, sys: 1e+03 ns, total: 3 µs
Wall time: 8.58 µs
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-15-47a6b92292f6> in <module>()
1 get_ipython().run_line_magic('time', '')
2 for i in range(200):
----> 3 step.run()
NameError: name 'step' is not defined
In [16]:
CPU times: user 2 µs, sys: 1e+03 ns, total: 3 µs
Wall time: 5.48 µs
In [17]:
In [0]:
In [0]:
In [0]:
Julia Set
In [18]:
In [19]:
In [20]:
In [21]:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-21-0d3a8d5a8cbe> in <module>()
1 jwork_ = jwork*jwork + jconst
2
----> 3 not_diverged = tf.complex_abs(jwork_) < 4
4
5 julia_step = tf.group(
AttributeError: module 'tensorflow' has no attribute 'complex_abs'
In [0]:
In [22]:
CPU times: user 2 µs, sys: 1 µs, total: 3 µs
Wall time: 6.2 µs
In [23]:
In [0]:
Does skflow also work?
In [24]:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-24-72ff285e2262> in <module>()
1 import random
2
----> 3 from sklearn import datasets, cross_validation, metrics
4 from sklearn import preprocessing
5
ImportError: cannot import name 'cross_validation'
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]: