Skip to content
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

Model reset parameters #151

Open
hellorp1990 opened this issue Nov 21, 2022 · 0 comments
Open

Model reset parameters #151

hellorp1990 opened this issue Nov 21, 2022 · 0 comments

Comments

@hellorp1990
Copy link

Hi,

I was working on cross validation/ splitting data using different seed points and then train a PyCOX model before averaging the result.

``for seed in SEEDS:

data, target = X1,Z1
X_train1,X_test,Z_train1,Z_test = train_test_split(data, target, test_size=0.25, random_state=seed)
X_train,X_val,Z_train,Z_val = train_test_split(X_train1,Z_train1, test_size=0.25, random_state=seed)

there are some steps here and I posted the required sections.

log = model.fit(X_train, y_train, batch_size, epochs, callbacks,verbose, val_data=val, val_batch_size=batch_size)

##added the following to reset the parameters

for layer in model.children():
if hasattr(layer, 'reset_parameters'):
layer.reset_parameters()

For the first fold/split the result of c-index is always low and then after couple of SEEDS the performance kept growing up. Hence, i believe the training model was not re-initialized after training one fold.

Does anyone know how to fix this issue and reset/re-initialize model for every fold.

Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant