pulse-coupled-nn


Namepulse-coupled-nn JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/ArdeleanRichard/PCNN
SummaryPython implementation of the Pulse Coupled Neural Network (PCNN)
upload_time2024-05-08 05:43:00
maintainerNone
docs_urlNone
authorEugen-Richard Ardelean
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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 pulse_coupled_nn import FLM
from pulse_coupled_nn import ICM
from pulse_coupled_nn import ClassicalPCNN
from pulse_coupled_nn import SCM
from pulse_coupled_nn 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()
```





            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ArdeleanRichard/PCNN",
    "name": "pulse-coupled-nn",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Eugen-Richard Ardelean",
    "author_email": "ardeleaneugenrichard@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/43/30/b8f50bd777d3846d133d3e6b1dddfa0593488ca4389539564ee265736fae/pulse_coupled_nn-0.0.6.tar.gz",
    "platform": null,
    "description": "# PCNN\r\nPython implementation of the Pulse Coupled Neural Network (PCNN) alongside multiple variations:\r\n- Classical PCNN\r\n- Feature Linking Model (FLM)\r\n- Intersecting Cortical Model (ICM)\r\n- Multi Linking Model (MLM)\r\n- Spiking Cortical Model (SCM)\r\n- Sigmoidal Linking Model (SLM)\r\n\r\nInstall:\r\n```\r\npip install pulse_coupled_nn\r\n```\r\n\r\nUsage example:\r\n```\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nfrom pulse_coupled_nn import FLM\r\nfrom pulse_coupled_nn import ICM\r\nfrom pulse_coupled_nn import ClassicalPCNN\r\nfrom pulse_coupled_nn import SCM\r\nfrom pulse_coupled_nn import SLM\r\n\r\n\r\ndef run_image_segm(gamma=1, beta=2, v_theta=400, kernel_size=3, kernel='gaussian'):\r\n\r\n    image = np.array(\r\n        [[230, 230, 230, 230, 115, 115, 115, 115],\r\n        [230, 230, 230, 230, 115, 115, 115, 115],\r\n        [230, 230, 205, 205, 103, 103, 115, 115],\r\n        [230, 230, 205, 205, 103, 103, 115, 115],\r\n        [230, 230, 205, 205, 103, 103, 115, 115],\r\n        [230, 230, 230, 230, 115, 115, 115, 115],\r\n        [230, 230, 230, 230, 115, 115, 115, 115]]\r\n    )\r\n\r\n    model = ClassicalPCNN(image.shape, kernel, kernel_size=kernel_size)\r\n    segm_image = model.segment_image(image, gamma=gamma, beta=beta, v_theta=v_theta, kernel_type='gaussian')\r\n\r\n    plt.imshow(image)\r\n    plt.colorbar()\r\n    plt.show()\r\n\r\n    plt.imshow(segm_image)\r\n    plt.colorbar()\r\n    plt.show()\r\n\r\n\r\nrun_image_segm()\r\n```\r\n\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python implementation of the Pulse Coupled Neural Network (PCNN)",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/ArdeleanRichard/PCNN"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "215a26a1c0f9a0883e07ba463504b9d9adab03c5ef8822670ef92a532bbe5dac",
                "md5": "823ddaa8f0c86995b89c87ea44b1a344",
                "sha256": "397bb0d458b5a56c385fe4ff8430dbf5723541f5db6d4a1121b7a052ac063d99"
            },
            "downloads": -1,
            "filename": "pulse_coupled_nn-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "823ddaa8f0c86995b89c87ea44b1a344",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 19485,
            "upload_time": "2024-05-08T05:42:57",
            "upload_time_iso_8601": "2024-05-08T05:42:57.008611Z",
            "url": "https://files.pythonhosted.org/packages/21/5a/26a1c0f9a0883e07ba463504b9d9adab03c5ef8822670ef92a532bbe5dac/pulse_coupled_nn-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4330b8f50bd777d3846d133d3e6b1dddfa0593488ca4389539564ee265736fae",
                "md5": "1b635b8a86560c6c192e20d2bef0443d",
                "sha256": "5c9558144efc17ecfeb2b9dfc1eb74e2ffc3415579e7fc696af53d73b1d9a749"
            },
            "downloads": -1,
            "filename": "pulse_coupled_nn-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "1b635b8a86560c6c192e20d2bef0443d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6356,
            "upload_time": "2024-05-08T05:43:00",
            "upload_time_iso_8601": "2024-05-08T05:43:00.218887Z",
            "url": "https://files.pythonhosted.org/packages/43/30/b8f50bd777d3846d133d3e6b1dddfa0593488ca4389539564ee265736fae/pulse_coupled_nn-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-08 05:43:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ArdeleanRichard",
    "github_project": "PCNN",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pulse-coupled-nn"
}
        
Elapsed time: 0.24750s