Explain the forward and backward propagation steps in a fully connected layer. How do you optimize memory consumption during backpropagation?