havakv / havakv/pycox

Model reset parameters

Open
#151 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
995
Forks
203
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.