Mean and Standard Deviation of outputs on a neural network
I am trying to train a Bayesian neural network, and with 5 inputs and 4 outputs. In the end, I want to have a mean prediction for all the outputs and a estimate of the standard deviation. When I ran the following code, it says that the network must have an output layer. I am wondering whats incorrect. I have followed this example.
numResponses = 4; % y1 y2 y3 y4
featureDimension = 5; % u1 u2 u3 u4 u5 % with feedback imep
% featureDimension = 4; % u1 u2 u3 u4 u5
maxEpochs = 2; % IMPORTANT PARAMETER
miniBatchSize = 512; % IMPORTANT PARAMETER
addpath(‘C:Usersvasu3DocumentsMATLABExamplesR2024annetTrainBayesianNeuralNetworkUsingBayesByBackpropExample’)
% architecture
Networklayer_h2df = […
sequenceInputLayer(featureDimension)
fullyConnectedLayer(4*numHiddenUnits1)
reluLayer
bayesFullyConnectedLayer(4*numHiddenUnits1,Sigma1=1,Sigma2=0.5)
reluLayer
fullyConnectedLayer(8*numHiddenUnits1)
reluLayer
gruLayer(LSTMStateNum,’OutputMode’,’sequence’,InputWeightsInitializer=’he’,RecurrentWeightsInitializer=’he’)
fullyConnectedLayer(8*numHiddenUnits1)
reluLayer
fullyConnectedLayer(4*numHiddenUnits1)
reluLayer
fullyConnectedLayer(numResponses)
bayesFullyConnectedLayer(numResponses,Sigma1=1,Sigma2=0.5)
];I am trying to train a Bayesian neural network, and with 5 inputs and 4 outputs. In the end, I want to have a mean prediction for all the outputs and a estimate of the standard deviation. When I ran the following code, it says that the network must have an output layer. I am wondering whats incorrect. I have followed this example.
numResponses = 4; % y1 y2 y3 y4
featureDimension = 5; % u1 u2 u3 u4 u5 % with feedback imep
% featureDimension = 4; % u1 u2 u3 u4 u5
maxEpochs = 2; % IMPORTANT PARAMETER
miniBatchSize = 512; % IMPORTANT PARAMETER
addpath(‘C:Usersvasu3DocumentsMATLABExamplesR2024annetTrainBayesianNeuralNetworkUsingBayesByBackpropExample’)
% architecture
Networklayer_h2df = […
sequenceInputLayer(featureDimension)
fullyConnectedLayer(4*numHiddenUnits1)
reluLayer
bayesFullyConnectedLayer(4*numHiddenUnits1,Sigma1=1,Sigma2=0.5)
reluLayer
fullyConnectedLayer(8*numHiddenUnits1)
reluLayer
gruLayer(LSTMStateNum,’OutputMode’,’sequence’,InputWeightsInitializer=’he’,RecurrentWeightsInitializer=’he’)
fullyConnectedLayer(8*numHiddenUnits1)
reluLayer
fullyConnectedLayer(4*numHiddenUnits1)
reluLayer
fullyConnectedLayer(numResponses)
bayesFullyConnectedLayer(numResponses,Sigma1=1,Sigma2=0.5)
]; I am trying to train a Bayesian neural network, and with 5 inputs and 4 outputs. In the end, I want to have a mean prediction for all the outputs and a estimate of the standard deviation. When I ran the following code, it says that the network must have an output layer. I am wondering whats incorrect. I have followed this example.
numResponses = 4; % y1 y2 y3 y4
featureDimension = 5; % u1 u2 u3 u4 u5 % with feedback imep
% featureDimension = 4; % u1 u2 u3 u4 u5
maxEpochs = 2; % IMPORTANT PARAMETER
miniBatchSize = 512; % IMPORTANT PARAMETER
addpath(‘C:Usersvasu3DocumentsMATLABExamplesR2024annetTrainBayesianNeuralNetworkUsingBayesByBackpropExample’)
% architecture
Networklayer_h2df = […
sequenceInputLayer(featureDimension)
fullyConnectedLayer(4*numHiddenUnits1)
reluLayer
bayesFullyConnectedLayer(4*numHiddenUnits1,Sigma1=1,Sigma2=0.5)
reluLayer
fullyConnectedLayer(8*numHiddenUnits1)
reluLayer
gruLayer(LSTMStateNum,’OutputMode’,’sequence’,InputWeightsInitializer=’he’,RecurrentWeightsInitializer=’he’)
fullyConnectedLayer(8*numHiddenUnits1)
reluLayer
fullyConnectedLayer(4*numHiddenUnits1)
reluLayer
fullyConnectedLayer(numResponses)
bayesFullyConnectedLayer(numResponses,Sigma1=1,Sigma2=0.5)
]; deep learning, machine learning, neural network MATLAB Answers — New Questions