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

Initialize Concat network automatically #77

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Prev Previous commit
Adjust for passing input_size.
  • Loading branch information
kaminow committed Sep 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit f117a60f73fa7e8c2b8c3714ce576a99d2916a45
18 changes: 17 additions & 1 deletion mtenn/conversion_utils/schnet.py
Original file line number Diff line number Diff line change
@@ -143,6 +143,22 @@ def _get_complex_only_strategy(self):

return ComplexOnlyStrategy(self._get_energy_func())

def _get_concat_strategy(self):
"""
Build a :py:class:`ConcatStrategy <mtenn.strategy.ConcatStrategy>` object with
the appropriate ``input_size``.

Returns
-------
ConcatStrategy
``ConcatStrategy`` for the model
"""

# Calculate input size as 3 * dimensionality of output of Representation
# (ie lin1 layer)
input_size = 3 * self.lin1.out_features
return ConcatStrategy(input_size=input_size)

@staticmethod
def get_model(
model=None,
@@ -203,7 +219,7 @@ def get_model(
if strategy == "delta":
strategy = model._get_delta_strategy()
elif strategy == "concat":
strategy = ConcatStrategy()
strategy = model._get_concat_strategy()
elif strategy == "complex":
strategy = model._get_complex_only_strategy()
else:
Loading
Oops, something went wrong.