<jupyter_start><jupyter_text>Tensorflow DemoTensorflow is an open source library developed by Google for Deep Learning  Getting started - Mandelbrot Set<jupyter_code>import tensorflow as tf
import numpy as np

import PIL.Image
from io import BytesIO
from IPython.display import Image, display
def DisplayFractal(a, fmt='jpeg'):
    a_cyclic = (6.28*a/20.0).reshape(list(a.shape)+[1])
    img = np.concatenate([10+20*np.cos(a_cyclic),
                          30+50*anp.sin(a_cyclic),
                          155-80*np.cos(a_cyclic)], 2)
    img[a==a.max()] = 0
    a = img
    a = np.uint8(np.clip(a, 0, 255))
    f = BytesIO()
    PIL.Image.fromarray(a).save(f, fmt)
    display(Image(data=f.getvalue()))
sess = tf.InteractiveSession()
Y, X = np.mgrid[-1.3:1.3:0.005, -2:1:0.005]
Z = X+1j*Y
xs = tf.constant(Z.astype(np.complex64))
zs = tf.Variable(xs)
ns = tf.Variable(tf.zeros_like(xs, tf.float32))
tf.initialize_all_variables().run()
zs_ = zs*zs + xs

not_diverged = tf.abs(zs_) < 4

step = tf.group(
    zs.assign(zs_),
    ns.assign_add(tf.cast(not_diverged, tf.float32))
)
for i in range(200): step.run()
DisplayFractal(ns.eval())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1564102564102564, 'fraction_numerical': 0.044444444444444446, 'mean_word_length': 3.6653386454183265, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '597138', 'license': 'MIT', 'n_tokens_mistral': 500, 'n_tokens_neox': 473, 'n_words': 91, 'path': 'src/tensorflow.ipynb', 'repo_name': 'sameerpandya/gsaoffsite_2017', 'size': '1170'}