-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Erf function goes beyond [-1,1] #191
Comments
On the phone, but one quick thought - could it be related to labels being
exactly 1/-1, which are outside of the image of ERF / apply_fn (-1; 1)?
…On Wed, Nov 15, 2023, 17:20 bangxiangyong ***@***.***> wrote:
The NN with erf function output activation can occassionally output way
beyond the boundary [-1,1]:
from jax import random
from neural_tangents import stax
import neural_tangents as nt
import random as rd
init_fn, apply_fn, kernel_fn = stax.serial(
stax.Dense(1),
stax.Relu(),
stax.Dense(1),
stax.Relu(),
stax.Dense(1),
stax.Relu(),
stax.Dense(1),
stax.Erf(),
)
key1, key2 = random.split(random.PRNGKey(777))
x1 = random.normal(key1, (100, 10))
x2 = random.normal(key2, (100, 10))
x_train, x_test = x1, x2
y_train = [rd.choice([-1, 1]) for i in range(100)]
y_train = np.array(y_train)[:, np.newaxis]
predict_fn = nt.predict.gradient_descent_mse_ensemble(kernel_fn, x_train, y_train)
y_test_nngp = predict_fn(x_test=x_test, get="nngp")
print(y_test_nngp.max()) ## 1.6560178
print(y_test_nngp.min()) ## -2.244388
Is this intended or have i missed something?
—
Reply to this email directly, view it on GitHub
<#191>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKTTJJIBICIDANL4IUVMLIDYET2XJAVCNFSM6AAAAAA7M26XEGVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4TKMRRGEYDCOI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I don't have a good answer yet, but it appears that bad conditioning of |
The NN with erf function output activation can occassionally output way beyond the boundary [-1,1]:
Is this intended or have i missed something?
The text was updated successfully, but these errors were encountered: