This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # import tensorflow | |
| import tensorflow as tf | |
| # create a tensorflow object called hello_constant | |
| hello_constant = tf.constant(‘Hello Wolrd !’) | |
| # create a tensorflow session | |
| with tf.Session() as sess: | |
| # Run the tf.constant operation in the session | |
| output = sess.run(hello_constant) | |
| print(output) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # import tensorflow | |
| import tensorflow as tf | |
| # creating placeholders | |
| x = tf.placeholder(tf.string) | |
| # create a tensorflow session | |
| with tf.Session() as sess: | |
| #Run the tf.constant operation in the session | |
| output = sess.run(x, feed_dict={x: ‘Hello People’}) | |
| print(output) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //*************************************************************************** | |
| //*****************************CREATED BY --> STUDENTS*********************** | |
| //*************************************************************************** | |
| //*************************************************************************** | |
| //*****************************HEADER FILES USED***************************** | |
| //*************************************************************************** | |
| #include<stdio.h> | |
| #include<conio.h> | |
| #include<graphics.h> | |
| #include<alloc.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create a tensorflow session | |
| with tf.Session() as sess: | |
| #Run the tf.constant operation in the session | |
| output = sess.run([x,y,z], feed_dict={x: ‘People’, y: 456, z:10.2}) | |
| print(output) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| from future.standard_library import install_aliases | |
| install_aliases() | |
| from urllib.parse import urlparse, urlencode | |
| from urllib.request import urlopen, Request | |
| from urllib.error import HTTPError | |
| import json | |
| import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create a tensorflow session | |
| with tf.Session() as sess: | |
| #Run the tf.constant operation in the session | |
| output = sess.run([x,y,z], feed_dict={x: 'People', y: 456, z:10.2}) | |
| print(output) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # import tensorflow | |
| import tensorflow as tf | |
| # creating placeholders | |
| x = tf.placeholder(tf.string) | |
| y = tf.placeholder(tf.int32) | |
| z = tf.placeholder(tf.float32) | |
| # create a tensorflow session | |
| with tf.Session() as sess: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # import tensorflow | |
| import tensorflow as tf | |
| # creating placeholders | |
| x = tf.placeholder(tf.int32) | |
| y = tf.placeholder(tf.int32) | |
| # creating placeholder for multiplication | |
| z = tf.multiply(x, y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def split_test_train(size, price): | |
| # split the data, test size = 33% | |
| size_train, size_test, price_train, price_test = train_test_split(size, price, test_size = 0.33) | |
| return size_train, size_test, price_train, price_test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Normalise the data | |
| size_train = normalise(size_train) | |
| price_train = normalise(price_train) | |
| size_test = normalise(size_test) | |
| price_test = normalise(price_test) | |
| #after normalisation before normalisation | |
| plt.scatter(size, price, label = 'Samples data') | |
| plt.draw() |
OlderNewer