Energy output prediction using MLPs in TensorFlow

Let's now see how good an MLP is for predicting energy output. This will be a regression problem. We will be using a single hidden layer MLP and will predict the net hourly electrical energy output from a combined cycle power plant. The description of the dataset is provided in Chapter 1, Principles and foundations of IoT and AI. Since it's a regression problem, our loss function remains the same as before. The complete code implementing the MLP class is given as follows:

class MLP:    def __init__(self,n_input=2,n_hidden=4, n_output=1, act_func=[tf.nn.elu, tf.sigmoid], learning_rate= 0.001):        self.n_input = n_input # Number of inputs to the neuron        self.act_fn = act_func        seed = 123  self.X = tf.placeholder(tf.float32, ...

Get Hands-On Artificial Intelligence for IoT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.