Describe the problem
In current base class implementation, the flatten function is incorrectly applied before the adapter.
Proposed Solution
Update the application order for the flatten and adapter functions in the base class.
Additional Context
Current documentation in base class:
"""
...
The architecture is structured as follows:
+------------------+
| Backbone Model |
+------------------+
|
v
+------------------------+
| Adapter (Optional) |
+------------------------+
|
(Flatten if needed)
v
+------------------------+
| Fully Connected Head |
+------------------------+
|
v
+------------------+
| Loss Function |
+------------------+
...
"""
Meanwhile, in the implementation (lines 192 to 197):
if self.flatten:
x = x.reshape(x.size(0), -1)
if self.adapter is not None:
x = self.adapter(x)
Steps to Reproduce
Steps to reproduce the behavior:
- Go to https://github.com/discovery-unicamp/Minerva/blob/main/minerva/models/nets/base.py#L193
- See the issue
Expected Behavior
Adapters must be applied BEFORE the flatten function.
Screenshots
Describe the problem
In current base class implementation, the flatten function is incorrectly applied before the adapter.
Proposed Solution
Update the application order for the flatten and adapter functions in the base class.
Additional Context
Current documentation in base class:
Meanwhile, in the implementation (lines 192 to 197):
Steps to Reproduce
Steps to reproduce the behavior:
Expected Behavior
Adapters must be applied BEFORE the flatten function.
Screenshots