Skip to content

How does MonotonicMLP work? #44

Answered by francois-rozet
CaioDaumann asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @CaioDaumann,

zuko.nn.MonotonicMLP is indeed a monotonic MLP, that is a (parametric) function $y = f(x)$ for which increasing any input feature $x_i$ leads to an increase in the output features $y_j$.

Now how does it work? One way to construct a monotonic function is by adding (not substracting) several monotonic functions together. So, to construct a monotonic MLP, you simply have to impose the weights of the linear layers to be positive, and the activation functions to be monotonic.

In Zuko's implementation, the weights are made positive by taking their absolute value (an alternative would be to use softplus or exp), and the activation function is $ELU(x)$ for half the hidden feat…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@CaioDaumann
Comment options

@francois-rozet
Comment options

Answer selected by CaioDaumann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants