An accuracy of 0% sounds concerning, as your model would be worse than just predicting classes randomly.
Anyway, your approach looks valid and self.A would get valid gradients. You could check these gradients for their values and see, if the sigmoid is maybe saturating and thus prevent a proper training.