-
Notifications
You must be signed in to change notification settings - Fork 32
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
EigenReporter and VINC algorithm #124
Conversation
…ill equal CCS loss." string to be accurate
num_heads: The number of reporter heads to fit. In other words, the number | ||
of eigenvectors to compute from the VINC matrix. | ||
""" | ||
|
||
inv_weight: float = 5.0 | ||
neg_cov_weight: float = 5.0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to add a var_weight as well, because we might want to set var_weight=0 (the confidence term).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you commit this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's now resolved, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually it looks like it's not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see it earlier for some reason
for more information, see https://pre-commit.ci
…to eigen-reporter
LOSSES[name](logit0, logit1, coef) for name, coef in self.loss_dict.items() | ||
) | ||
return assert_type(torch.Tensor, loss) | ||
|
||
def reset_parameters(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abstractmethod
missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not missing because EigenReporter doesn't need it
torch.zeros(in_features, in_features, device=device, dtype=dtype), | ||
) | ||
self.register_buffer( | ||
"intracluster_cov", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@norabelrose @AlexTMallen I changed the name of this, since it was "intercluster_cov_M2" before... which was already registered in line 77. The fix prevents the error:
File "/mnt/ssd-1/nora/miniconda3/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/mnt/ssd-1/notodai/walter/elk/elk/training/train.py", line 103, in train_reporter
reporter = EigenReporter(x0.shape[-1], cfg.net, device=device)
File "/mnt/ssd-1/notodai/walter/elk/elk/training/eigen_reporter.py", line 74, in __init__
self.intracluster_cov
File "/mnt/ssd-1/notodai/walter/elk/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1269, in __getattr__
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'EigenReporter' object has no attribute 'intracluster_cov'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/mnt/ssd-1/notodai/walter/elk/.venv/bin/elk", line 8, in <module>
sys.exit(run())
File "/mnt/ssd-1/notodai/walter/elk/elk/__main__.py", line 57, in run
train(args.run, args.output)
File "/mnt/ssd-1/notodai/walter/elk/elk/training/train.py", line 195, in train
for i, *stats in tqdm(mapper(fn, layers), total=len(layers)):
File "/mnt/ssd-1/notodai/walter/elk/.venv/lib/python3.10/site-packages/tqdm/std.py", line 1195, in __iter__
for obj in iterable:
File "/mnt/ssd-1/nora/miniconda3/lib/python3.10/multiprocessing/pool.py", line 873, in next
raise value
AttributeError: 'EigenReporter' object has no attribute 'intracluster_cov'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks good catch
No description provided.