Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d576d1e
Updating version number.
Nov 14, 2019
f1e753d
Update README.md
djsaunde Nov 19, 2019
0163fc6
Updating setup.py to reflect new repo.
Dec 16, 2019
f3c981d
Merge branch 'master' of github.com:BINDS-LAB-UMASS/bindsnet
Dec 16, 2019
65a1ddf
Update README.md
djsaunde Dec 16, 2019
ba72992
Create pythonpackage.yml
djsaunde Dec 16, 2019
657dd8f
Create pythonpackage.yml
djsaunde Dec 16, 2019
c705675
Update pythonpackage.yml
djsaunde Dec 17, 2019
38e655c
Update README.md
djsaunde Dec 17, 2019
1e72959
Update pythonpackage.yml
djsaunde Dec 17, 2019
48252d9
Black formatting.
Dec 22, 2019
2042d69
Formatting issues.
Dec 22, 2019
54f41fc
Update pythonpackage.yml
djsaunde Dec 22, 2019
038aaaf
Update pythonpackage.yml
djsaunde Dec 22, 2019
8c338df
Refactored conversion module.
Dec 23, 2019
8630c4b
Updating autodoc.
Dec 23, 2019
53c04d5
Update pythonpackage.yml
djsaunde Dec 23, 2019
f1af643
Delete pythonpackage.yml
djsaunde Dec 23, 2019
6142446
Update pythonpackage.yml
djsaunde Dec 23, 2019
6ff8e5a
Fixing homepage + download URL.
Feb 25, 2020
0eff397
Make firing_rate init consistent with reset
dee0512 Feb 26, 2020
fb31814
Merge pull request #5 from dee0512/master
djsaunde Feb 26, 2020
0521319
fix to show example # in perf_plot
coopersigrist Mar 2, 2020
25e12fb
changed plotting.py to include x_scale
coopersigrist Mar 2, 2020
058732f
adding doc for x_scale
coopersigrist Mar 2, 2020
32b24fe
modified: bindsnet/conversion/conversion.py
WeihaoTan Mar 3, 2020
f0d20f7
Merge branch 'master' into docs-update
Mar 3, 2020
51767f6
Merge pull request #1 from BINDS-LAB-UMASS/docs-update
djsaunde Mar 3, 2020
2baaefb
modified: bindsnet/network/topology.py
WeihaoTan Mar 4, 2020
643cec4
Merge pull request #8 from WeihaoTan/master
djsaunde Mar 5, 2020
58c6eb0
Merge pull request #7 from coopersigrist/master
djsaunde Mar 5, 2020
dbad95c
Update pythonpackage.yml
djsaunde Sep 1, 2020
3ca676b
Black formatting with default line length.
Sep 1, 2020
24d1c0e
checkout/merge original repo versions of files w/ no functional diffe…
petermarathas Oct 1, 2020
1a9da32
Merge branch 'master' into second_repo_merge
petermarathas Oct 14, 2020
89a626e
add x_scale logic for case "save is not None"
petermarathas Oct 14, 2020
08d39c3
update pythonpackage.yml
petermarathas Oct 14, 2020
ccfe3bf
remove formatting changes from monitors.py
petermarathas Oct 14, 2020
e3c2a6b
Merge branch 'master' of github.com:BindsNET/bindsnet into second_rep…
petermarathas Dec 6, 2020
b9bf53f
Running black
Hananel-Hazan Jan 5, 2021
7247f41
Restore banchmark examples
Hananel-Hazan Jan 6, 2021
7da25bc
Restore pre-commit
Hananel-Hazan Jan 6, 2021
273f4d3
Merge branch 'master' into second_repo_merge
Hananel-Hazan Jan 6, 2021
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
32 changes: 32 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Python package

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install . --progress-bar off
- name: Format with black
run: |
pip install black
black .
- name: Test with pytest
run: |
pip install pytest
pytest
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ examples/saved_checkpoints
# macOS
.DS_Store

benchmark/
figures/

# Analyzer log default directory.
Expand Down
Empty file modified .pre-commit-config.yaml
100644 → 100755
Empty file.
65 changes: 51 additions & 14 deletions bindsnet/analysis/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def plot_spikes(
for i, datum in enumerate(spikes.items()):
spikes = (
datum[1][
time[0] : time[1], n_neurons[datum[0]][0] : n_neurons[datum[0]][1]
time[0] : time[1],
n_neurons[datum[0]][0] : n_neurons[datum[0]][1],
]
.detach()
.clone()
Expand Down Expand Up @@ -143,14 +144,19 @@ def plot_spikes(
ax.set_aspect("auto")

plt.setp(
axes, xticks=[], yticks=[], xlabel="Simulation time", ylabel="Neuron index"
axes,
xticks=[],
yticks=[],
xlabel="Simulation time",
ylabel="Neuron index",
)
plt.tight_layout()
else:
for i, datum in enumerate(spikes.items()):
spikes = (
datum[1][
time[0] : time[1], n_neurons[datum[0]][0] : n_neurons[datum[0]][1]
time[0] : time[1],
n_neurons[datum[0]][0] : n_neurons[datum[0]][1],
]
.detach()
.clone()
Expand Down Expand Up @@ -409,7 +415,10 @@ def plot_assignments(
else:
color = plt.get_cmap("RdBu", len(classes) + 1)
im = ax.matshow(
locals_assignments, cmap=color, vmin=-1.5, vmax=len(classes) - 0.5
locals_assignments,
cmap=color,
vmin=-1.5,
vmax=len(classes) - 0.5,
)

div = make_axes_locatable(ax)
Expand Down Expand Up @@ -468,6 +477,7 @@ def plot_performance(
performances: Dict[str, List[float]],
ax: Optional[Axes] = None,
figsize: Tuple[int, int] = (7, 4),
x_scale: int = 1,
save: Optional[str] = None,
) -> Axes:
# language=rst
Expand All @@ -477,6 +487,7 @@ def plot_performance(
:param performances: Lists of training accuracy estimates per voting scheme.
:param ax: Used for re-drawing the performance plot.
:param figsize: Horizontal, vertical figure size in inches.
:param x_scale: scaling factor for the x axis, equal to the number of examples per performance measure
:param save: file name to save fig, if None = not saving fig.
:return: Used for re-drawing the performance plot.
"""
Expand All @@ -487,7 +498,7 @@ def plot_performance(

for scheme in performances:
ax.plot(
range(len(performances[scheme])),
[n * x_scale for n in range(len(performances[scheme]))],
[p for p in performances[scheme]],
label=scheme,
)
Expand All @@ -496,7 +507,6 @@ def plot_performance(
ax.set_title("Estimated classification accuracy")
ax.set_xlabel("No. of examples")
ax.set_ylabel("Accuracy")
ax.set_xticks(())
ax.set_yticks(range(0, 110, 10))
ax.legend()

Expand All @@ -511,7 +521,7 @@ def plot_performance(

for scheme in performances:
ax.plot(
range(len(performances[scheme])),
[n * x_scale for n in range(len(performances[scheme]))],
[p for p in performances[scheme]],
label=scheme,
)
Expand All @@ -520,7 +530,6 @@ def plot_performance(
ax.set_title("Estimated classification accuracy")
ax.set_xlabel("No. of examples")
ax.set_ylabel("Accuracy")
ax.set_xticks(())
ax.set_yticks(range(0, 110, 10))
ax.legend()

Expand Down Expand Up @@ -598,7 +607,9 @@ def plot_voltages(
):
ims.append(
axes.axhline(
y=thresholds[v[0]].item(), c="r", linestyle="--"
y=thresholds[v[0]].item(),
c="r",
linestyle="--",
)
)
else:
Expand All @@ -615,7 +626,13 @@ def plot_voltages(
)
)

args = (v[0], n_neurons[v[0]][0], n_neurons[v[0]][1], time[0], time[1])
args = (
v[0],
n_neurons[v[0]][0],
n_neurons[v[0]][1],
time[0],
time[1],
)
plt.title("%s voltages for neurons (%d - %d) from t = %d to %d " % args)
plt.xlabel("Time (ms)")

Expand Down Expand Up @@ -644,7 +661,9 @@ def plot_voltages(
):
ims.append(
axes[i].axhline(
y=thresholds[v[0]].item(), c="r", linestyle="--"
y=thresholds[v[0]].item(),
c="r",
linestyle="--",
)
)
else:
Expand All @@ -660,7 +679,13 @@ def plot_voltages(
cmap=cmap,
)
)
args = (v[0], n_neurons[v[0]][0], n_neurons[v[0]][1], time[0], time[1])
args = (
v[0],
n_neurons[v[0]][0],
n_neurons[v[0]][1],
time[0],
time[1],
)
axes[i].set_title(
"%s voltages for neurons (%d - %d) from t = %d to %d " % args
)
Expand Down Expand Up @@ -702,7 +727,13 @@ def plot_voltages(
.T,
cmap=cmap,
)
args = (v[0], n_neurons[v[0]][0], n_neurons[v[0]][1], time[0], time[1])
args = (
v[0],
n_neurons[v[0]][0],
n_neurons[v[0]][1],
time[0],
time[1],
)
axes.set_title(
"%s voltages for neurons (%d - %d) from t = %d to %d " % args
)
Expand Down Expand Up @@ -738,7 +769,13 @@ def plot_voltages(
.T,
cmap=cmap,
)
args = (v[0], n_neurons[v[0]][0], n_neurons[v[0]][1], time[0], time[1])
args = (
v[0],
n_neurons[v[0]][0],
n_neurons[v[0]][1],
time[0],
time[1],
)
axes[i].set_title(
"%s voltages for neurons (%d - %d) from t = %d to %d " % args
)
Expand Down
Loading