stanfordnlp / pyvene

Stanford NLP Python Library for Understanding and Improving PyTorch Models via Interventions
http://pyvene.ai
Apache License 2.0
559 stars 50 forks source link

[Minor] Adding in subspace support for lambda #113

Closed frankaging closed 5 months ago

frankaging commented 5 months ago

Description

Currently, the code assumes whenever we use customized function or lambda expression based interventions, we only allow two arguments. This. change allows us to specify the subspace for these interventions as well.

Ideally, the third argument could be anything for these customized interventions, which will be a future change.

Testing Done

Tutorial test is added.

Checklist: