Beginner: Solar & Cloud NN

Hi there,

i am very new to NNs and pyTorch. Is this the right approach to learn how the production evolves over the day taking the percentage of clouds into account?

import matplotlib.pyplot as plt
class Solar(torch.nn.Module):
    def __init__(self, inputSize, outputSize):
        super(Solar, self).__init__()
        self.linear1a = torch.nn.Linear(inputSize, outputSize)        
        self.linear1b = torch.nn.Linear(inputSize, outputSize)
        self.linear2 = torch.nn.Linear(inputSize, outputSize)    
        self.relu = torch.nn.ReLU()
        self.linear3 = torch.nn.Linear(inputSize, outputSize)        

    def forward(self, hours, clouds):
        out_hours = self.linear1a(hours)        
        out_clouds = self.linear1b(clouds)        
        out_c = self.linear2(out_hours-clouds)
        out_d = self.relu(out_c)
        out_e = self.linear3(out_d)
        
        return out_e

I am asking because the network learn negative values in the early morging and late night.
Loss is stuck at 0.001

Regards

Tim

Regards

Iā€™m not familiar with your use case, but I guess you want to subtract out_clounds from out_hours here:

out_c = self.linear2(out_hours-clouds)

instead of the clouds input tensor?

1 Like

Yes, you are right.

But still i am stuck at 0.00091 loss and the edges are negative.

Here is the training data.

Initializing helped to get rid of the negative edges.

        torch.nn.init.normal_(self.linear1a.weight)
        torch.nn.init.constant_(self.linear1b.weight, 0.5)
        torch.nn.init.ones_(self.linear2.weight)
        torch.nn.init.ones_(self.linear3.weight) 

Still stuck at 0.001 average loss.