Skip to main content

No project description provided

Project description

the original code belongs to Raphael Pisoni and Github repo: https://github.com/sleepingcat4/sharpened-cosine-similarity/blob/main/keras/README.md

I wrapped the code around for this Python library

send me an email if you require help

How to use

from sharpcosine import CosSim2D
from sharpcosine import MaxAbsPool2D

model = tf.keras.Sequential(
    [
        tf.keras.layers.InputLayer(input_shape=input_shape),
        CosSim2D(3, 32),
        MaxAbsPool2D(2, True),
        CosSim2D(3, 64,),
        MaxAbsPool2D(2, True),
        CosSim2D(3, 128),
        MaxAbsPool2D(2, True),
        tf.keras.layers.Flatten(),
        tf.keras.layers.Dense(num_classes)
    ]
)

Credit: https://www.rpisoni.dev/posts/cossim-convolution-part2/

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

sharpcosine-0.1.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

sharpcosine-0.1.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file sharpcosine-0.1.1.tar.gz.

File metadata

  • Download URL: sharpcosine-0.1.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for sharpcosine-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4e76e51d721bc1043208f27335f7fd00c58d85317ed732fdacf58f3acac9a85d
MD5 1a88e6269a70fae70d9951856afd94e4
BLAKE2b-256 5211b266fa545145dc861bded17ddd50a9a6c578bd1593c62b381295ac2122dc

See more details on using hashes here.

File details

Details for the file sharpcosine-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sharpcosine-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for sharpcosine-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9926335084b93b8c4ae1e2c9159a4a3928bc969fceae3dbbd0f4385c3d0165c5
MD5 5a8857fdd6995e4f3aa95d04ea6a6e1f
BLAKE2b-256 5e6cb874f7d2600b05effabb2197ab89c13299fbcfe394012ea1d459d37d3311

See more details on using hashes here.

Supported by

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