Let's start a real thing with TensorFlow. In this scenario, you will use the linearly separable data you've worked with before and apply TensorFlow to conduct the classification task.
We will build a simple neural network to accomplish the task. This will allow us to tweak the architecture more in the next scenarios.
You've completed TensorFlow Network Training scenario.
You've learned how to accomplish the following tasks using TensorFlow:
- Create placeholders
- Building the fully connected layers for the Neural Network
- Set up the optimisation task
- Training the network
- Evaluating the classifier
TensorFlow Network Training
In this scenario, we will use TensorFlow for the task of building and training a simple neural network. As the dataset, we will be using the linearly separable one that you had a chance to work previously.
To start working on the task, open the
neural_network.py file. Include some necessary imports and read the data.
import pandas as pd import numpy as np import tensorflow as tf # Read data data = pd.read_csv('dataset.csv') X = data.as_matrix(['x1', 'x2']) Y = data.as_matrix(['label'])
We are also defining some of the values that will be use further in the code:
learning_rate = 0.05 steps_number = 200