Potential Analog Network Synthesis for Arbitrary Loss Functions