Skip to main content

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

pulse_coupled_nn-0.0.4.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pulse_coupled_nn-0.0.4-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file pulse_coupled_nn-0.0.4.tar.gz.

File metadata

  • Download URL: pulse_coupled_nn-0.0.4.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.9

File hashes

Hashes for pulse_coupled_nn-0.0.4.tar.gz
Algorithm Hash digest
SHA256 adfb2c48d86ee68ab5ef30a823fb0681ec34fae34066af9d2db09cfaf5d2b083
MD5 3d0b89d4466a2c50a548ba30b58a2e6a
BLAKE2b-256 e93a0910f50b9270aa8496543be4468803839a51252c469b2c5bb30bf8a8755c

See more details on using hashes here.

File details

Details for the file pulse_coupled_nn-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pulse_coupled_nn-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 88defb782845090699770491b69992b383fde92c8de517a2da9f5cf15ee33df4
MD5 ac6d6e13e7ced27d4c2c3dae39dda8ed
BLAKE2b-256 45c7d6dad292472f6e74e540469999fafc2953b7f0ee956d8cbe9b870619594c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page