public MyNeuronNetwork(int inputs, int outputs,IMyNeuronFunction<U> calcFunc) throws Exception
    {
        if((inputs & (inputs - 1)) != 0)// if not power of two
        {
            throw new Exception("input number must be a power of two");
        }
        if((outputs & (outputs - 1)) != 0 && outputs !=1)//if not power of two or number 1
        {
            throw new Exception("outputs number must be a power of two or number 1 but it is "+outputs);
        }
        if(calcFunc==null)
        {
            throw new Exception("calcFunc cannot be null");
        }
        this.calcFunc=calcFunc;
        inputDataSize=inputs;
        outputDataSize=outputs;
        
        int totalWeights =0;
        int totalNeurons=0;
        int inputsCopy=inputs;
        while(inputsCopy!=outputs)
        {
            totalWeights+=inputsCopy;
            inputsCopy/=inputsPerNeuron;
            totalNeurons+=inputsCopy;
        }
        this.totalDataCount=totalWeights+totalNeurons;      
        
    }