ApolloResearch / rib

Library for methods related to the Local Interaction Basis (LIB)
MIT License
3 stars 0 forks source link

WIP: Create Sequential Component #272

Closed danbraunai-apollo closed 6 months ago

danbraunai-apollo commented 7 months ago

Create Sequential Component

Description

Related Issue

Motivation and Context

The goal for this was to have a SequentialComponent that would have in_dims and out_dims properties that are used elsewhere as well as making it cleaner to get the bias positions.

I was mistaken about the use-case for the out_dims. Currently thinking that this PR will only be useful if it makes bias positions much better.

Regardless, there are still these issues with the current commits:

Note that my first implementation stored the previous component inside each component. But this was an issue because when you do state_dict(), it will print out that previous component (and thus all components in the sequence) twice. A better solution there would have been to create a dictionary somewhere and just stored a pointer to the previous module instance. That seemed a little messy, also I thought I only needed the out_dims of the previous module, so I went about storing those (equivalent to the in_dims of the current module) directly. Then I realised the issue about needing the folded_bias thing.

I think it's only worth continuing here if we deem it to be very useful for centering. Otherwise we can bin this.

How Has This Been Tested?

Does this PR introduce a breaking change?