I want to implement a variant of logistic regression in PyTorch to solve a binary classification problem I'm dealing with. Here's the architecture I want to implement:
Each training example is an m by n matrix, X, and I want to learn a weight vector, w, of length m and a bias term, b, so that my output probability is as shown in this LaTeX equation. Is there a way to get PyTorch to do this so I don't have to explicitly program how to calculate the gradients of the cost function?