Try to implement Adaptive Batch Norm for GAN

My task has the following description:

We condition on the noise vector multiple times throughout the network. One of the most popular ways of doing that is via adaptive batch normalization:

π‘₯=π‘₯βˆ’πœ‡πœŽπ›Ύ+𝛽,𝛾=𝑓(𝑧), 𝛽=𝑔(𝑧)

The first part of this operation is a standard batch normalization, but instead of optimizing 𝛾 and 𝛽 as a vector, we optimize functions 𝑓 and 𝑔 , which predict affine parameters from a noise vector 𝑧 . Typically these functions are simple linear mappings.

I don’t know how to do that. I am pretty new to PyTorch. Please, help me.