Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpretability module: sparse linear models via LASSO #120

Merged
merged 26 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1ccbbce
Added Lasso notebook
pietronvll Jan 17, 2024
b345809
add lasso module
luigibonati Jan 30, 2024
e51871b
uploaded drafts of lasso notebooks
luigibonati Jan 30, 2024
df937a9
Merge remote-tracking branch 'origin/main' into interpretability
luigibonati Jun 5, 2024
e80ca9c
create explain submodule
luigibonati Jun 5, 2024
5489c4b
fix tests and warnings
luigibonati Jun 6, 2024
f54428b
add lasso regtests
luigibonati Jun 6, 2024
55ca602
fix return plot functions
luigibonati Jun 6, 2024
e71ff1f
updated stateinterpreter tutorial
luigibonati Jun 6, 2024
91fdf8c
updated lasso tutorials
luigibonati Jun 6, 2024
0192845
updated docs
luigibonati Jun 6, 2024
2aec410
fix doc and tutorials
luigibonati Jun 6, 2024
b8bb9f7
fix loops in lasso
luigibonati Jun 6, 2024
343fea6
updated documentation
luigibonati Jun 6, 2024
90fca93
fix indentation in committor notebook
luigibonati Jun 6, 2024
d117fab
fixed committor notebook
luigibonati Jun 6, 2024
9b7a217
long training for committor
luigibonati Jun 6, 2024
314e595
Fixed tutorials
EnricoTrizio Jun 6, 2024
f712c10
Merge branch 'interpretability' of https://github.com/luigibonati/mlc…
EnricoTrizio Jun 6, 2024
6ea925f
Plot longer training results in preview
EnricoTrizio Jun 6, 2024
35c5c45
fix lasso tutorial
luigibonati Jun 11, 2024
15ef1d9
raise error in lasso regression if target is not scalar
luigibonati Jun 11, 2024
5b26950
improved plot_features_distribution
luigibonati Jun 11, 2024
9b09f4e
run sphinx to update doc
luigibonati Jun 11, 2024
e3aec8f
remove utils
luigibonati Jun 11, 2024
71ad599
fix sensitivity notebook
luigibonati Jun 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,18 @@ Here we provide PyTorch- and Lightning-compatible classes that simplify and impr

.. rubric:: Utils

Here one can find a set of miscellaneous tools and helper functions for a smoother workflow.
Miscellaneous tools and helper functions:

.. toctree::
:maxdepth: 1
:caption: API:

api_utils

Tools for inspecting & interpreting the models.

.. toctree::
:maxdepth: 1
:caption: API:

api_explain
2 changes: 2 additions & 0 deletions docs/api_cvs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ General framework which allows to optimize a single model with different loss fu

Framework for the numerical determination of the committor function based on its variational principle.

.. rubric:: Committor

.. currentmodule:: mlcolvar.cvs

.. autosummary::
Expand Down
30 changes: 30 additions & 0 deletions docs/api_explain.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Explain
-------

.. rubric:: Sensitivity analysis

Perform sensitivity analysis to identify feature relevances

.. currentmodule:: mlcolvar.explain.sensitivity

.. autosummary::
:toctree: autosummary
:template: custom-class-template.rst

sensitivity_analysis
plot_sensitivity

.. rubric:: Sparse linear model

Use sparse models to approximate classification/regression tasks

.. currentmodule:: mlcolvar.explain.lasso

.. autosummary::
:toctree: autosummary
:template: custom-class-template.rst

lasso_classification
lasso_regression
plot_lasso_classification
plot_lasso_regression
21 changes: 16 additions & 5 deletions docs/api_utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ Create a dataset of pairs of time-lagged configurations.

.. rubric:: FES

.. rubric:: Trainer

Functions used in conjunction with the lightning Trainer (e.g. logging, metrics...).

.. currentmodule:: mlcolvar.utils.trainer

.. autosummary::
:toctree: autosummary
:template: custom-class-template.rst

MetricsCallback

Compute (and plot) the free energy surface along the CVs.

.. currentmodule:: mlcolvar.utils.fes
Expand All @@ -38,14 +50,13 @@ Compute (and plot) the free energy surface along the CVs.

compute_fes

.. rubric:: Trainer
Plotting utils

Functions used in conjunction with the lightning Trainer (e.g. logging, metrics...).

.. currentmodule:: mlcolvar.utils.trainer
.. currentmodule:: mlcolvar.utils.plot

.. autosummary::
:toctree: autosummary
:template: custom-class-template.rst

MetricsCallback
plot_metrics
plot_features_distribution
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
mlcolvar.core.transform.descriptors.CoordinationNumbers
=======================================================

.. currentmodule:: mlcolvar.core.transform.descriptors

.. autoclass:: CoordinationNumbers
:members:
:show-inheritance:
:inherited-members: Module,LightningModule


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~CoordinationNumbers.__init__
~CoordinationNumbers.compute_coordination_number
~CoordinationNumbers.forward




..


.. rubric:: Attributes

.. autosummary::

~CoordinationNumbers.T_destination
~CoordinationNumbers.call_super_init
~CoordinationNumbers.dump_patches
~CoordinationNumbers.training




Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
mlcolvar.core.transform.descriptors.EigsAdjMat
==============================================

.. currentmodule:: mlcolvar.core.transform.descriptors

.. autoclass:: EigsAdjMat
:members:
:show-inheritance:
:inherited-members: Module,LightningModule


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~EigsAdjMat.__init__
~EigsAdjMat.compute_adjacency_matrix
~EigsAdjMat.forward
~EigsAdjMat.get_eigenvalues




..


.. rubric:: Attributes

.. autosummary::

~EigsAdjMat.T_destination
~EigsAdjMat.call_super_init
~EigsAdjMat.dump_patches
~EigsAdjMat.training




Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
mlcolvar.core.transform.descriptors.MultipleDescriptors
=======================================================

.. currentmodule:: mlcolvar.core.transform.descriptors

.. autoclass:: MultipleDescriptors
:members:
:show-inheritance:
:inherited-members: Module,LightningModule


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~MultipleDescriptors.__init__
~MultipleDescriptors.forward




..


.. rubric:: Attributes

.. autosummary::

~MultipleDescriptors.T_destination
~MultipleDescriptors.call_super_init
~MultipleDescriptors.dump_patches
~MultipleDescriptors.training




Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
mlcolvar.core.transform.descriptors.PairwiseDistances
=====================================================

.. currentmodule:: mlcolvar.core.transform.descriptors

.. autoclass:: PairwiseDistances
:members:
:show-inheritance:
:inherited-members: Module,LightningModule


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~PairwiseDistances.__init__
~PairwiseDistances.compute_pairwise_distances
~PairwiseDistances.forward




..


.. rubric:: Attributes

.. autosummary::

~PairwiseDistances.T_destination
~PairwiseDistances.call_super_init
~PairwiseDistances.dump_patches
~PairwiseDistances.training




Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
mlcolvar.core.transform.descriptors.TorsionalAngle
==================================================

.. currentmodule:: mlcolvar.core.transform.descriptors

.. autoclass:: TorsionalAngle
:members:
:show-inheritance:
:inherited-members: Module,LightningModule


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~TorsionalAngle.__init__
~TorsionalAngle.compute_torsional_angle
~TorsionalAngle.forward




..


.. rubric:: Attributes

.. autosummary::

~TorsionalAngle.MODES
~TorsionalAngle.T_destination
~TorsionalAngle.call_super_init
~TorsionalAngle.dump_patches
~TorsionalAngle.training




Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
mlcolvar.core.transform.tools.ContinuousHistogram
=================================================

.. currentmodule:: mlcolvar.core.transform.tools

.. autoclass:: ContinuousHistogram
:members:
:show-inheritance:
:inherited-members: Module,LightningModule


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~ContinuousHistogram.__init__
~ContinuousHistogram.compute_hist
~ContinuousHistogram.forward




..


.. rubric:: Attributes

.. autosummary::

~ContinuousHistogram.T_destination
~ContinuousHistogram.call_super_init
~ContinuousHistogram.dump_patches
~ContinuousHistogram.training




44 changes: 44 additions & 0 deletions docs/autosummary/mlcolvar.core.transform.tools.Normalization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
mlcolvar.core.transform.tools.Normalization
===========================================

.. currentmodule:: mlcolvar.core.transform.tools

.. autoclass:: Normalization
:members:
:show-inheritance:
:inherited-members: Module,LightningModule


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~Normalization.__init__
~Normalization.extra_repr
~Normalization.forward
~Normalization.inverse
~Normalization.set_custom
~Normalization.set_from_stats
~Normalization.setup_from_datamodule




..


.. rubric:: Attributes

.. autosummary::

~Normalization.T_destination
~Normalization.call_super_init
~Normalization.dump_patches
~Normalization.training




Loading
Loading