-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
got recursive docs generation working
- Loading branch information
1 parent
589d0a5
commit ffdaae6
Showing
13 changed files
with
128 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
sphinx>=6.0.0,<7.3.0 | ||
sphinx-book-theme>=1.0.1 | ||
sphinx-collections>=0.0.1 | ||
myst-nb>=1.0.0 | ||
myst-parser>=3.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{ fullname | escape | underline}} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. autoclass:: {{ objname }} | ||
:members: | ||
:show-inheritance: | ||
|
||
{% block methods %} | ||
.. automethod:: __init__ | ||
|
||
{% if methods %} | ||
.. rubric:: {{ _('Methods') }} | ||
|
||
.. autosummary:: | ||
{% for item in methods %} | ||
~{{ name }}.{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block attributes %} | ||
{% if attributes %} | ||
.. rubric:: {{ _('Attributes') }} | ||
|
||
.. autosummary:: | ||
{% for item in attributes %} | ||
~{{ name }}.{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{ fullname | escape | underline}} | ||
|
||
.. automodule:: {{ fullname }} | ||
|
||
{% block attributes %} | ||
{% if attributes %} | ||
.. rubric:: Module Attributes | ||
|
||
.. autosummary:: | ||
:toctree: | ||
{% for item in attributes %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block functions %} | ||
{% if functions %} | ||
.. rubric:: {{ _('Functions') }} | ||
|
||
.. autosummary:: | ||
:toctree: | ||
{% for item in functions %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block classes %} | ||
{% if classes %} | ||
.. rubric:: {{ _('Classes') }} | ||
|
||
.. autosummary:: | ||
:toctree: | ||
:template: pv-class.rst | ||
{% for item in classes %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block exceptions %} | ||
{% if exceptions %} | ||
.. rubric:: {{ _('Exceptions') }} | ||
|
||
.. autosummary:: | ||
:toctree: | ||
{% for item in exceptions %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block modules %} | ||
{% if modules %} | ||
.. rubric:: Modules | ||
|
||
.. autosummary:: | ||
:toctree: | ||
:template: pv-module.rst | ||
:recursive: | ||
{% for item in modules %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,14 @@ | ||
``pyvene``: Core API | ||
========================================= | ||
|
||
.. module:: pyvene | ||
.. currentmodule:: pyvene | ||
.. automodule:: pyvene | ||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
interventions | ||
wrappers | ||
models | ||
|
||
|
||
Core model wrappers | ||
------------------- | ||
|
||
Whenever we want to wrap a model with intervention capabilities, the following classes are used: | ||
|
||
.. autosummary:: | ||
|
||
IntervenableConfig | ||
RepresentationConfig | ||
IntervenableModel | ||
IntervenableNdifModel | ||
build_intervenable_model | ||
|
||
Interventions | ||
------------- | ||
|
||
Pyvene supports many types of interventions out-of-the-box. They are: | ||
.. rubric:: Modules | ||
|
||
.. autosummary:: | ||
CollectIntervention | ||
ZeroIntervention | ||
VanillaIntervention | ||
AdditionIntervention | ||
SubtractionIntervention | ||
NoiseIntervention | ||
RotatedSpaceIntervention | ||
BoundlessRotatedSpaceIntervention | ||
SigmoidMaskRotatedSpaceIntervention | ||
LowRankRotatedSpaceIntervention | ||
PCARotatedSpaceIntervention | ||
SigmoidMaskIntervention | ||
AutoencoderIntervention | ||
|
||
Additionally, we have abstract classes that you may use to create your own interventions: | ||
:toctree: | ||
:template: pv-module.rst | ||
:recursive: | ||
|
||
.. autosummary:: | ||
Intervention | ||
LocalistRepresentationIntervention | ||
DistributedRepresentationIntervention | ||
TrainableIntervention | ||
ConstantSourceIntervention | ||
SourcelessIntervention | ||
BasisAgnosticIntervention | ||
SharedWeightsTrainableIntervention | ||
SkipIntervention | ||
|
||
|
||
Built-in model types | ||
-------------------- | ||
|
||
Pyvene supports many types of models out-of-the-box. There are two dictionaries which | ||
record useful information about these models: | ||
|
||
.. autosummary:: | ||
type_to_module_mapping | ||
type_to_dimension_mapping | ||
|
||
We provide the following model types with unified helper names for their internal components: | ||
|
||
.. autosummary:: | ||
create_gpt2 | ||
create_gpt2_lm | ||
create_blip | ||
create_blip_itm | ||
create_gpt_neo | ||
create_gpt_neox | ||
create_gru | ||
create_gru_lm | ||
create_gru_classifier | ||
create_llava | ||
create_llama | ||
create_mlp_classifier | ||
create_backpack_gpt2 | ||
pyvene.data_generators | ||
pyvene.models |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.