This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add model parameters / modules inspection helper. (#2466)
* Adds inspection method on models to view parameters and modules. * Add a test. * Fix a typo. * Fix another typo. * Fix mypy and docs. * Revert changes on model. * Add inspect_model_parameters and tests. * Avert circular import (for now). * Remove extra blank lines. * Allow modules instead of restricting to only model. * Add a blank line. * Allow too many lines in util_test.py * update inspection util. * pylint and mypy. * Update docstring.
- Loading branch information
1 parent
0fbd1ca
commit cf247c6
Showing
3 changed files
with
84 additions
and
0 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
39 changes: 39 additions & 0 deletions
39
allennlp/tests/fixtures/decomposable_attention/parameters_inspection.json
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,39 @@ | ||
{ | ||
"_aggregate_feedforward": { | ||
"_linear_layers": { | ||
"0": { | ||
"bias": "tunable", | ||
"weight": "tunable" | ||
} | ||
} | ||
}, | ||
"_attend_feedforward": { | ||
"_module": { | ||
"_linear_layers": { | ||
"0": { | ||
"bias": "tunable", | ||
"weight": "tunable" | ||
} | ||
} | ||
} | ||
}, | ||
"_compare_feedforward": { | ||
"_module": { | ||
"_linear_layers": { | ||
"0": { | ||
"bias": "tunable", | ||
"weight": "tunable" | ||
} | ||
} | ||
} | ||
}, | ||
"_text_field_embedder": { | ||
"token_embedder_tokens": { | ||
"_projection": { | ||
"bias": "tunable", | ||
"weight": "tunable" | ||
}, | ||
"weight": "frozen" | ||
} | ||
} | ||
} |
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