<jupyter_start><jupyter_text>Softmax Tensorflow © <NAME> 2018Hey there! Welcome to `J.S Codes` jupyter notebooks for TensorFlow!In this notebook we'll learn to implement the `cross entropy` using tensorflow.<jupyter_code>import tensorflow as tf

softmax_data = [0.7, 0.2, 0.1]
one_hot_data = [1.0, 0.0, 0.0]

softmax = tf.placeholder(tf.float32)
one_hot = tf.placeholder(tf.float32)


# TODO: Print cross entropy from session
cross_entropy = -1  * tf.reduce_sum(tf.multiply(one_hot, tf.log(softmax)))
with tf.Session() as sess:
    print(sess.run(cross_entropy, feed_dict = {softmax : softmax_data, one_hot : one_hot_data}))<jupyter_output>0.35667497
{'fraction_non_alphanumeric': 0.12, 'fraction_numerical': 0.046153846153846156, 'mean_word_length': 5.642857142857143, 'pattern_counts': {'":': 0, '<': 5, '<?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': '192207', 'license': 'MIT', 'n_tokens_mistral': 263, 'n_tokens_neox': 244, 'n_words': 60, 'path': '2ndMeetup-Resources/Demo/TensorFlow/Practice/02_IntroToTensorFlow/.ipynb_checkpoints/03_CrossEntropy-checkpoint.ipynb', 'repo_name': 'jubeenshah/School-of-ai-2nd-meetup', 'size': '655'}