Skip to content

Commit

Permalink
adjust requirements.txt installation and use hidden_dim for sizing mo…
Browse files Browse the repository at this point in the history
…re effectively in InteractionBlock
  • Loading branch information
RylieWeaver committed Oct 2, 2024
1 parent 173ae67 commit 6d53ff6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade -r requirements.txt -r requirements-dev.txt
python -m pip install --upgrade -r requirements-torch.txt --index-url https://download.pytorch.org/whl/cpu
python -m pip install --upgrade -r requirements-torch2.txt
python -m pip install --upgrade -r requirements-torch.txt --index-url https://download.pytorch.org/whl/cpu --extra-index-url https://pypi.org/simple
python -m pip install --upgrade -r requirements-pyg.txt --find-links https://data.pyg.org/whl/torch-2.0.1+cpu.html
python -m pip install --upgrade -r requirements-deepspeed.txt
- name: Format black
Expand Down
18 changes: 14 additions & 4 deletions hydragnn/utils/model/mace_utils/modules/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,19 @@ def __repr__(self):
)


###########################################################################################
# NOTE: Below is one of the many possible Interaction Blocks in the MACE architecture.
# Since there are adaptations to the original code in order to be integrated with
# the HydraGNN framework, and the changes between blocks are relatively minor, we've
# elected to adapt one general-purpose block here. Users can access the other blocks
# and adapt similarly from the original MACE code (linked with date at the top).
###########################################################################################
@compile_mode("script")
class RealAgnosticAttResidualInteractionBlock(InteractionBlock):
def _setup(self) -> None:
self.node_feats_down_irreps = o3.Irreps(
"64x0e"
) # Interesting, this seems to be a required shaping
[(o3.Irreps(self.hidden_irreps).count(o3.Irrep(0, 1)), (0, 1))]
)
# First linear
self.linear_up = o3.Linear(
self.node_feats_irreps,
Expand Down Expand Up @@ -313,9 +320,12 @@ def _setup(self) -> None:
)
# The following specifies the network architecture for embedding l=0 (scalar) irreps
## It is worth double-checking, but I believe this means that type 0 (scalar) irreps
## are being embedded by 3 layers of size 256 and the output dim, then activated.
# are being embedded by 3 layers of size self.hidden_dim (scalar irreps) and the
# output dim, then activated.
self.conv_tp_weights = nn.FullyConnectedNet(
[input_dim] + 3 * [256] + [self.conv_tp.weight_numel],
[input_dim]
+ 3 * [o3.Irreps(self.hidden_irreps).count(o3.Irrep(0, 1))]
+ [self.conv_tp.weight_numel],
torch.nn.functional.silu,
)

Expand Down
4 changes: 3 additions & 1 deletion requirements-torch.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
torch==2.0.1
torchvision
torchaudio

e3nn==0.5.1
torch-ema==0.3
torchmetrics==1.4.0
3 changes: 0 additions & 3 deletions requirements-torch2.txt

This file was deleted.

0 comments on commit 6d53ff6

Please sign in to comment.