Python implementation of the Pulse Coupled Neural Network (PCNN)
Project description
PCNN
Python implementation of the Pulse Coupled Neural Network (PCNN) alongside multiple variations:
- Classical PCNN
- Feature Linking Model (FLM)
- Intersecting Cortical Model (ICM)
- Multi Linking Model (MLM)
- Spiking Cortical Model (SCM)
- Sigmoidal Linking Model (SLM)
Install:
pip install pulse_coupled_nn
Usage example:
import numpy as np
import matplotlib.pyplot as plt
from pcnn import FLM
from pcnn import ICM
from pcnn import ClassicalPCNN
from pcnn import SCM
from pcnn import SLM
def run_image_segm(gamma=1, beta=2, v_theta=400, kernel_size=3, kernel='gaussian'):
image = np.array(
[[230, 230, 230, 230, 115, 115, 115, 115],
[230, 230, 230, 230, 115, 115, 115, 115],
[230, 230, 205, 205, 103, 103, 115, 115],
[230, 230, 205, 205, 103, 103, 115, 115],
[230, 230, 205, 205, 103, 103, 115, 115],
[230, 230, 230, 230, 115, 115, 115, 115],
[230, 230, 230, 230, 115, 115, 115, 115]]
)
model = ClassicalPCNN(image.shape, kernel, kernel_size=kernel_size)
segm_image = model.segment_image(image, gamma=gamma, beta=beta, v_theta=v_theta, kernel_type='gaussian')
plt.imshow(image)
plt.colorbar()
plt.show()
plt.imshow(segm_image)
plt.colorbar()
plt.show()
run_image_segm()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pulse_coupled_nn-0.0.5.tar.gz.
File metadata
- Download URL: pulse_coupled_nn-0.0.5.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
535afe3560176929f91140b04b2de08e7ff30fedb987c4de4f129aa7e123f148
|
|
| MD5 |
a391a35a099db10a27d12ff771ade425
|
|
| BLAKE2b-256 |
37e5913bc990b685e208f6d4aa6299f99c57d0443275681b6fd479d136226ab5
|
File details
Details for the file pulse_coupled_nn-0.0.5-py3-none-any.whl.
File metadata
- Download URL: pulse_coupled_nn-0.0.5-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5645acc645934fadb59b759fa8f1687450a50093f6446fa0301219f32ac808e9
|
|
| MD5 |
08ffef0fdcdbf1d421d5c4aca3e8b861
|
|
| BLAKE2b-256 |
f12532f8be854f0c4c766426f8f729e12383476b162f5b94f2f27d7a5061c660
|