Skip to content

Instantly share code, notes, and snippets.

View blackzphoenix's full-sized avatar
🎯
Focusing

Black ZPhoenix blackzphoenix

🎯
Focusing
View GitHub Profile
# 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)
@blackzphoenix
blackzphoenix / tf_session.py
Created April 19, 2018 13:44
tensorflow session
# 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)
//***************************************************************************
//*****************************CREATED BY --> STUDENTS***********************
//***************************************************************************
//***************************************************************************
//*****************************HEADER FILES USED*****************************
//***************************************************************************
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<alloc.h>
# 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)
@blackzphoenix
blackzphoenix / sample.py
Created June 15, 2018 17:47
api.ai using python
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
@blackzphoenix
blackzphoenix / Creating a session.py
Created July 9, 2018 06:15
Creating a session and run the them
# 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)
# 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:
@blackzphoenix
blackzphoenix / Placeholder_multiplication.py
Created July 9, 2018 07:11
Create two placeholders and multiply them by feeding values for them and run
# 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)
@blackzphoenix
blackzphoenix / split_commad.py
Created July 9, 2018 07:17
Splitting the command and assigning test size as 33 percent.
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
@blackzphoenix
blackzphoenix / Normalisation.py
Created July 9, 2018 07:20
Normalisation and plotting them.
# 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()