Skip to content

Commit 5b4488e

Browse files
authored
Merge branch 'main' into hls4ml-optimization-api-part-1
2 parents aac3f1f + 3158eca commit 5b4488e

File tree

91 files changed

+4204
-505
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+4204
-505
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
with:
1515
fetch-depth: 0
1616
ref: ${{ github.event.pull_request.head.sha }}

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
submodules: recursive
2222

.github/workflows/pypi-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout source
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
with:
1717
submodules: recursive
1818
fetch-depth: 0

.github/workflows/test-sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
with:
1515
fetch-depth: 0
1616
ref: ${{ github.event.pull_request.head.sha }}

.github/workflows/update-branch-on-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout repo
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name && github.event.label.name == 'please test' }}
1414
with:
1515
ref: ${{ github.event.pull_request.head.sha }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ docs/_build
1313
docs/autodoc/*
1414
hls4mlprj_*
1515
*~
16+
*.ipynb_checkpoints/

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ stages:
55

66
generator:
77
stage: generate
8-
image: python:3.7-alpine
8+
image: python:3.8-alpine
99
tags:
1010
- docker
1111
before_script:

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ exclude: (^hls4ml\/templates\/(vivado|quartus)\/(ap_types|ac_types)\/|^test/pyte
22

33
repos:
44
- repo: https://github.com/psf/black
5-
rev: 23.3.0
5+
rev: 23.7.0
66
hooks:
77
- id: black
88
language_version: python3
@@ -30,18 +30,18 @@ repos:
3030
args: ["--profile", "black", --line-length=125]
3131

3232
- repo: https://github.com/asottile/pyupgrade
33-
rev: v3.4.0
33+
rev: v3.10.1
3434
hooks:
3535
- id: pyupgrade
3636
args: ["--py36-plus"]
3737

3838
- repo: https://github.com/asottile/setup-cfg-fmt
39-
rev: v2.3.0
39+
rev: v2.4.0
4040
hooks:
4141
- id: setup-cfg-fmt
4242

4343
- repo: https://github.com/pycqa/flake8
44-
rev: 6.0.0
44+
rev: 6.1.0
4545
hooks:
4646
- id: flake8
4747
exclude: docs/conf.py

contrib/garnet.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -313,35 +313,36 @@ def _setup_transforms(self, n_aggregators, n_filters, n_propagate):
313313
name=('Fout%d' % it),
314314
)
315315

316-
# Check for correctness. This commented out because pre-commit showed it was unused.
317-
318-
# if self._output_activation is None or self._output_activation == "linear":
319-
# output_activation_transform = (QActivation("quantized_bits(%i, %i)"
320-
# % (self._total_bits, self._int_bits)))
321-
# else:
322-
# output_activation_transform = QActivation(
323-
# "quantized_%s(%i, %i)" % (self._output_activation, self._total_bits, self._int_bits)
324-
# )
316+
if self._output_activation is None or self._output_activation == "linear":
317+
output_activation_transform = QActivation("quantized_bits(%i, %i)" % (self._total_bits, self._int_bits))
318+
else:
319+
output_activation_transform = QActivation(
320+
"quantized_%s(%i, %i)" % (self._output_activation, self._total_bits, self._int_bits)
321+
)
325322
else:
326323
input_feature_transform = NamedDense(p, name=('FLR%d' % it))
327324
output_feature_transform = NamedDense(f, name=('Fout%d' % it))
328-
# output_activation_transform = keras.layers.Activation(self._output_activation)
325+
output_activation_transform = keras.layers.Activation(self._output_activation)
329326

330327
aggregator_distance = NamedDense(a, name=('S%d' % it))
331328

332-
self._transform_layers.append((input_feature_transform, aggregator_distance, output_feature_transform))
329+
self._transform_layers.append(
330+
(input_feature_transform, aggregator_distance, output_feature_transform, output_activation_transform)
331+
)
333332

334333
self._sublayers = sum((list(layers) for layers in self._transform_layers), [])
335334

336335
def _build_transforms(self, data_shape):
337-
for in_transform, d_compute, out_transform in self._transform_layers:
336+
for in_transform, d_compute, out_transform, act_transform in self._transform_layers:
338337
in_transform.build(data_shape)
339338
d_compute.build(data_shape)
340339
if self._simplified:
341-
out_transform.build(data_shape[:2] + (d_compute.units * in_transform.units,))
340+
act_transform.build(out_transform.build(data_shape[:2] + (d_compute.units * in_transform.units,)))
342341
else:
343-
out_transform.build(
344-
data_shape[:2] + (data_shape[2] + d_compute.units * in_transform.units + d_compute.units,)
342+
act_transform.build(
343+
out_transform.build(
344+
data_shape[:2] + (data_shape[2] + d_compute.units * in_transform.units + d_compute.units,)
345+
)
345346
)
346347

347348
data_shape = data_shape[:2] + (out_transform.units,)

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pandas
77
pyyaml
88
seaborn
99
setuptools_scm[toml]>=5
10-
six
1110
sphinx>=3.2.1
1211
sphinx_contributors
1312
sphinx_github_changelog

0 commit comments

Comments
 (0)