Skip to main content

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/

Release files for sharpcosine 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sharpcosine 0.1.1
File Size Uploaded
sharpcosine-0.1.1.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sharpcosine 0.1.1
File Interpreter ABI Platform
sharpcosine-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.1 kB

Release files / sharpcosine-0.1.1.tar.gz

Download URL sharpcosine-0.1.1.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4e76e51d721bc1043208f27335f7fd00c58d85317ed732fdacf58f3acac9a85d
BLAKE2b-256 checksum
How to use checksums
5211b266fa545145dc861bded17ddd50a9a6c578bd1593c62b381295ac2122dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / sharpcosine-0.1.1-py3-none-any.whl

Download URL sharpcosine-0.1.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9926335084b93b8c4ae1e2c9159a4a3928bc969fceae3dbbd0f4385c3d0165c5
BLAKE2b-256 checksum
How to use checksums
5e6cb874f7d2600b05effabb2197ab89c13299fbcfe394012ea1d459d37d3311
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page