Browse Source

[MNT] install prolog on win and fix a minor bug in hed

pull/1/head
Gao Enhao 2 years ago
parent
commit
194a163bb5
2 changed files with 9 additions and 4 deletions
  1. +6
    -3
      .github/workflows/build-and-test.yaml
  2. +3
    -1
      examples/hed/bridge.py

+ 6
- 3
.github/workflows/build-and-test.yaml View File

@@ -21,9 +21,12 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Display python version
run: python -c "import sys; print(sys.version)"
- name: Install prolog
run: |
sudo apt-get install swi-prolog
- name: Install SWI-Prolog on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install swi-prolog
- name: Install SWI-Prolog on Windows
if: matrix.os == 'windows-latest'
run: choco install swi-prolog
- name: Install package dependencies
run: |
python -m pip install --upgrade pip


+ 3
- 1
examples/hed/bridge.py View File

@@ -233,7 +233,9 @@ class HedBridge(SimpleBridge):

seems_good = self.check_rule_quality(rules, val_data, equation_len)
if seems_good:
self.reasoner.kb.learned_rules.update({equation_len: rules})
self.reasoner.kb.learned_rules.update(
{equation_len: rules, equation_len + 1: rules}
)
self.model.save(
save_path=os.path.join(save_dir, f"eq_len_{equation_len}.pth")
)


Loading…
Cancel
Save