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

Protgnn update #19

Merged
merged 4 commits into from
Sep 20, 2024
Merged

Protgnn update #19

merged 4 commits into from
Sep 20, 2024

Conversation

Jeratt
Copy link
Collaborator

@Jeratt Jeratt commented Sep 5, 2024

Fix ProtGNN train due to new train procedure. Tested on back and tested on front - got reasonable prots and acc.

Copy link
Collaborator

@LukyanovKirillML LukyanovKirillML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо переписать обучение посредством вызова хуков (before_batch, after_batch, before_epoch, after_epoch, early_stopping).

early_stop_count = 0
best_prots = prot_layer.prototype_graphs
# data_indices = train_loader.dataset.indices
def train_complete(self, gen_dataset, steps=None, pbar=None, metrics=None, **kwargs):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

train_complete его наличие кажется необязательным

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если train_complete нужен только, чтобы early_stooping запустить после after_epoch, то необходимо просто переписать early_stooping, а не train_complete

loss.backward()
torch.nn.utils.clip_grad_value_(self.gnn.parameters(), clip_value=2.0)
self.optimizer.step()
return loss

def run_model(self, gen_dataset, mask='test', out='answers'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run_model его наличие кажется необязательным. (Скорее всего дублирует код родительского класса, если так, то надо убрать)

self.early_stop_count = 0
self.gnn.best_prots = self.prot_layer.prototype_graphs
self.best_acc = 0.0

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Также проверить evaluate_model его наличие кажется необязательным. (Скорее всего дублирует код родительского класса, если так, то надо убрать)

Copy link
Collaborator

@LukyanovKirillML LukyanovKirillML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right

@LukyanovKirillML LukyanovKirillML merged commit 704a10a into develop Sep 20, 2024
2 checks passed
@Jeratt Jeratt deleted the protgnn_update branch September 20, 2024 11:18
@Jeratt Jeratt restored the protgnn_update branch October 25, 2024 15:30
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

Successfully merging this pull request may close these issues.

2 participants