def predict_raw(self, input_data):
        number_of_inputs = input_data.shape[0]
        network_certainties = np.zeros((number_of_inputs, len(self.networks)))
        network_outputs = network_certainties.copy()

        for i, network in enumerate(self.networks):
            output = network.predict(input_data)
            minval, maxval = output.min(), output.max()

            if not (0 <= minval <= 1 and 0 <= maxval <= 1):
                raise ValueError(
                    "Netwrok output must be in range [0, 1]. Network output "
                    "was in range [{}, {}]".format(minval, maxval)
                )

            certainty = np.where(output > 0.5, output, 1 - output)

            network_certainties[:, i:i + 1] = certainty
            network_outputs[:, i:i + 1] = output

        total_output_sum = np.reshape(network_certainties.sum(axis=1),
                                      (number_of_inputs, 1))
        self.weights = network_certainties / total_output_sum
        return (self.weights * network_outputs).sum(axis=1)
dataset/ETHPy150Open itdxer/neupy/neupy/algorithms/ensemble/dan.py/DynamicallyAveragedNetwork.predict_raw/original