Given two neural networks that compute two functions $f(x)$ and $g(x)$, how can I create a neural network that computes $f(x)g(x)$?
Use another network h which takes f(x) and g(x) as input i.e. h(f(x), g(x)).
Training psuedo code(pytorch):
for epoch in epochs:
    for batch, x in dataset:
        train(f)
        train(g)


for epoch in epochs:
    for batch, x in dataset:
        # freeze f and g (using torch.no_grad in pytorch)
        with torch.no_grad:
            fx = f(x)
            gx = g(x)
        pred = h(fx, gx)
        loss = loss_fn(pred, (fx . gx))
        backpropagate()
        optimise()