IntelLabs / MART

Modular Adversarial Robustness Toolkit
BSD 3-Clause "New" or "Revised" License
16 stars 0 forks source link

Don't lookup non-str keys in `SequentialDict` #174

Closed dxoigmn closed 1 year ago

dxoigmn commented 1 year ago

What does this PR do?

SequentialDict always tries to find a corresponding value in a DotDict. This changes SequentialDict to only lookup values in a DotDict when it is a str. Other values are passed directly to the underlying module.

Type of change

Please check all relevant options.

Testing

Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.

Before submitting

Did you have fun?

Make sure you had fun coding 🙃

dxoigmn commented 1 year ago

This is useful if you wanted to do a weighted sum of losses. Right now you would have to pre-define the number and values of these weights. However, this enables us to pass the literal weight values via a sequence.