Created: February 12, 2023
Modified: February 13, 2023
Modified: February 13, 2023
relu inequality
This page is from my personal notes, and has not been specifically reviewed for public consumption. It might be incomplete, wrong, outdated, or stupid. Caveat lector.Suppose we want a transformer to evaluate the inequality
returning if and otherwise. For integer , this can be done with a feedforward ReLU network computing
Observe that for this is simply . For this is . Thus this expression computes the inequality.
If fails to be an integer and we have , then the expression evaluates to , which smoothly interpolates between the discrete outcomes of and .