tensorflow-wavelets


Nametensorflow-wavelets JSON
Version 1.0.31 PyPI version JSON
download
home_pagehttps://github.com/Timorleiderman/tensorflow-wavelets
SummaryTensorflow wavelet Layers
upload_time2024-12-20 11:20:02
maintainerNone
docs_urlNone
authorTimor Leiderman
requires_python>=3.6
licenseNone
keywords wavelets tensorflow
VCS
bugtrack_url
requirements scipy matplotlib tensorflow keras psnr-hvsm opencv-python scikit-image pywavelets tensorflow_probability numpy ipykernel protobuf pandas
Travis-CI No Travis.
coveralls test coverage No coveralls.
            tensorflow-wavelets is an implementation of Custom Layers for Neural Networks:
- *Discrete Wavelets Transform Layer*
- *Duel Tree Complex Wavelets Transform Layer*
- *Multi Wavelets Transform Layer*



# 
```
git clone https://github.com/Timorleiderman/tensorflow-wavelets.git
cd tensorflow-wavelets
pip install -r requirements.txt
```
## Installation
#### tested with python 3.8
```
pip install tensorflow-wavelets
```
# Usage
```
from tensorflow import keras
import tensorflow_wavelets.Layers.DWT as DWT
import tensorflow_wavelets.Layers.DTCWT as DTCWT
import tensorflow_wavelets.Layers.DMWT as DMWT

# Custom Activation function Layer
import tensorflow_wavelets.Layers.Threshold as Threshold
```

# Examples
## DWT(name="haar", concat=0)
### "name" can be found in pywt.wavelist(family)
### concat = 0 means to split to 4 smaller layers

```
from tensorflow import keras
model = keras.Sequential()
model.add(keras.Input(shape=(28, 28, 1)))
model.add(DWT.DWT(name="haar",concat=0))
model.add(keras.layers.Flatten())
model.add(keras.layers.Dense(nb_classes, activation="softmax"))
model.summary()
```

    _________________________________________________________________
    Layer (type)                 Output Shape              Param #
    =================================================================
    dwt_9_haar (DWT)             (None, 14, 14, 4)         0
    _________________________________________________________________
    flatten_9 (Flatten)          (None, 784)               0
    _________________________________________________________________
    dense_9 (Dense)              (None, 10)                7850
    =================================================================
    Total params: 7,850
    Trainable params: 7,850
    Non-trainable params: 0
    _________________________________________________________________

### name = "db4" concat = 1
```

model = keras.Sequential()
model.add(keras.layers.InputLayer(input_shape=(28, 28, 1)))
model.add(DWT.DWT(name="db4", concat=1))
model.summary()
```

    Model: "sequential"
    _________________________________________________________________
    Layer (type)                 Output Shape              Param #
    =================================================================
    dwt_db4 (DWT)                (None, 34, 34, 1)         0
    =================================================================
    Total params: 0
    Trainable params: 0
    Non-trainable params: 0
    _________________________________________________________________

# DMWT
### functional example with Sure Threshold
```

x_inp = keras.layers.Input(shape=(512, 512, 1))
x = DMWT.DMWT("ghm")(x_inp)
x = Threshold.Threshold(algo='sure', mode='hard')(x) # use "soft" or "hard"
x = DMWT.IDMWT("ghm")(x)
model = keras.models.Model(x_inp, x, name="MyModel")
model.summary()
```
    Model: "MyModel"
    _________________________________________________________________
    Layer (type)                 Output Shape              Param #
    =================================================================
    input_1 (InputLayer)         [(None, 512, 512, 1)]     0
    _________________________________________________________________
    dmwt (DMWT)                  (None, 1024, 1024, 1)     0
    _________________________________________________________________
    sure_threshold (SureThreshol (None, 1024, 1024, 1)     0
    _________________________________________________________________
    idmwt (IDMWT)                (None, 512, 512, 1)       0
    =================================================================
    Total params: 0
    Trainable params: 0
    Non-trainable params: 0
    _________________________________________________________________


## PyPi upload:
```
pip install --upgrade build
pip install --upgrade twine
python -m build
python -m twine upload --repository pypi dist/*

```

If our open source codes are helpful for your research, please cite our
[technical report:](https://www.mdpi.com/1099-4300/26/10/836)
```
@Article{e26100836,
AUTHOR = {Leiderman, Timor and Ben Ezra, Yosef},
TITLE = {Information Bottleneck Driven Deep Video Compression—IBOpenDVCW},
JOURNAL = {Entropy},
VOLUME = {26},
YEAR = {2024},
NUMBER = {10},
ARTICLE-NUMBER = {836},
URL = {https://www.mdpi.com/1099-4300/26/10/836},
ISSN = {1099-4300},
DOI = {10.3390/e26100836}
}
```

**Free Software, Hell Yeah!**

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Timorleiderman/tensorflow-wavelets",
    "name": "tensorflow-wavelets",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "Wavelets, Tensorflow",
    "author": "Timor Leiderman",
    "author_email": "Timorleiderman@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b5/42/eefffee3ea40b517cee480c4243371f102c647f6355f658d75d670af6795/tensorflow_wavelets-1.0.31.tar.gz",
    "platform": null,
    "description": "tensorflow-wavelets is an implementation of Custom Layers for Neural Networks:\n- *Discrete Wavelets Transform Layer*\n- *Duel Tree Complex Wavelets Transform Layer*\n- *Multi Wavelets Transform Layer*\n\n\n\n# \n```\ngit clone https://github.com/Timorleiderman/tensorflow-wavelets.git\ncd tensorflow-wavelets\npip install -r requirements.txt\n```\n## Installation\n#### tested with python 3.8\n```\npip install tensorflow-wavelets\n```\n# Usage\n```\nfrom tensorflow import keras\nimport tensorflow_wavelets.Layers.DWT as DWT\nimport tensorflow_wavelets.Layers.DTCWT as DTCWT\nimport tensorflow_wavelets.Layers.DMWT as DMWT\n\n# Custom Activation function Layer\nimport tensorflow_wavelets.Layers.Threshold as Threshold\n```\n\n# Examples\n## DWT(name=\"haar\", concat=0)\n### \"name\" can be found in pywt.wavelist(family)\n### concat = 0 means to split to 4 smaller layers\n\n```\nfrom tensorflow import keras\nmodel = keras.Sequential()\nmodel.add(keras.Input(shape=(28, 28, 1)))\nmodel.add(DWT.DWT(name=\"haar\",concat=0))\nmodel.add(keras.layers.Flatten())\nmodel.add(keras.layers.Dense(nb_classes, activation=\"softmax\"))\nmodel.summary()\n```\n\n    _________________________________________________________________\n    Layer (type)                 Output Shape              Param #\n    =================================================================\n    dwt_9_haar (DWT)             (None, 14, 14, 4)         0\n    _________________________________________________________________\n    flatten_9 (Flatten)          (None, 784)               0\n    _________________________________________________________________\n    dense_9 (Dense)              (None, 10)                7850\n    =================================================================\n    Total params: 7,850\n    Trainable params: 7,850\n    Non-trainable params: 0\n    _________________________________________________________________\n\n### name = \"db4\" concat = 1\n```\n\nmodel = keras.Sequential()\nmodel.add(keras.layers.InputLayer(input_shape=(28, 28, 1)))\nmodel.add(DWT.DWT(name=\"db4\", concat=1))\nmodel.summary()\n```\n\n    Model: \"sequential\"\n    _________________________________________________________________\n    Layer (type)                 Output Shape              Param #\n    =================================================================\n    dwt_db4 (DWT)                (None, 34, 34, 1)         0\n    =================================================================\n    Total params: 0\n    Trainable params: 0\n    Non-trainable params: 0\n    _________________________________________________________________\n\n# DMWT\n### functional example with Sure Threshold\n```\n\nx_inp = keras.layers.Input(shape=(512, 512, 1))\nx = DMWT.DMWT(\"ghm\")(x_inp)\nx = Threshold.Threshold(algo='sure', mode='hard')(x) # use \"soft\" or \"hard\"\nx = DMWT.IDMWT(\"ghm\")(x)\nmodel = keras.models.Model(x_inp, x, name=\"MyModel\")\nmodel.summary()\n```\n    Model: \"MyModel\"\n    _________________________________________________________________\n    Layer (type)                 Output Shape              Param #\n    =================================================================\n    input_1 (InputLayer)         [(None, 512, 512, 1)]     0\n    _________________________________________________________________\n    dmwt (DMWT)                  (None, 1024, 1024, 1)     0\n    _________________________________________________________________\n    sure_threshold (SureThreshol (None, 1024, 1024, 1)     0\n    _________________________________________________________________\n    idmwt (IDMWT)                (None, 512, 512, 1)       0\n    =================================================================\n    Total params: 0\n    Trainable params: 0\n    Non-trainable params: 0\n    _________________________________________________________________\n\n\n## PyPi upload:\n```\npip install --upgrade build\npip install --upgrade twine\npython -m build\npython -m twine upload --repository pypi dist/*\n\n```\n\nIf our open source codes are helpful for your research, please cite our\n[technical report:](https://www.mdpi.com/1099-4300/26/10/836)\n```\n@Article{e26100836,\nAUTHOR = {Leiderman, Timor and Ben Ezra, Yosef},\nTITLE = {Information Bottleneck Driven Deep Video Compression\u2014IBOpenDVCW},\nJOURNAL = {Entropy},\nVOLUME = {26},\nYEAR = {2024},\nNUMBER = {10},\nARTICLE-NUMBER = {836},\nURL = {https://www.mdpi.com/1099-4300/26/10/836},\nISSN = {1099-4300},\nDOI = {10.3390/e26100836}\n}\n```\n\n**Free Software, Hell Yeah!**\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Tensorflow wavelet Layers",
    "version": "1.0.31",
    "project_urls": {
        "Bug Tracker": "https://github.com/Timorleiderman/tensorflow-wavelets/issues",
        "Homepage": "https://github.com/Timorleiderman/tensorflow-wavelets"
    },
    "split_keywords": [
        "wavelets",
        " tensorflow"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d98e5d3f81de78a82d71a0f71f178731c04152fc2df7a7ca4d0c568e5118acb4",
                "md5": "decfbee1eeb433cadcb6100e552a7348",
                "sha256": "3c08f33ebfb92da409f2fd02a7c003734e2aa6cf83d3451c5a3c18d2d00cc2e0"
            },
            "downloads": -1,
            "filename": "tensorflow_wavelets-1.0.31-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "decfbee1eeb433cadcb6100e552a7348",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 26071,
            "upload_time": "2024-12-20T11:20:00",
            "upload_time_iso_8601": "2024-12-20T11:20:00.583640Z",
            "url": "https://files.pythonhosted.org/packages/d9/8e/5d3f81de78a82d71a0f71f178731c04152fc2df7a7ca4d0c568e5118acb4/tensorflow_wavelets-1.0.31-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b542eefffee3ea40b517cee480c4243371f102c647f6355f658d75d670af6795",
                "md5": "0d45d6588bae8551faa3838dcde8c4d8",
                "sha256": "475940a0ce5821f7e0a380d7fecb7d9e10e34f5f542098b2804c39cc5ec40f5c"
            },
            "downloads": -1,
            "filename": "tensorflow_wavelets-1.0.31.tar.gz",
            "has_sig": false,
            "md5_digest": "0d45d6588bae8551faa3838dcde8c4d8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 21880,
            "upload_time": "2024-12-20T11:20:02",
            "upload_time_iso_8601": "2024-12-20T11:20:02.911958Z",
            "url": "https://files.pythonhosted.org/packages/b5/42/eefffee3ea40b517cee480c4243371f102c647f6355f658d75d670af6795/tensorflow_wavelets-1.0.31.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-20 11:20:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Timorleiderman",
    "github_project": "tensorflow-wavelets",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "scipy",
            "specs": [
                [
                    "==",
                    "1.5.2"
                ]
            ]
        },
        {
            "name": "matplotlib",
            "specs": [
                [
                    "~=",
                    "3.4.3"
                ]
            ]
        },
        {
            "name": "tensorflow",
            "specs": [
                [
                    "==",
                    "2.6.1"
                ]
            ]
        },
        {
            "name": "keras",
            "specs": [
                [
                    "==",
                    "2.6"
                ]
            ]
        },
        {
            "name": "psnr-hvsm",
            "specs": [
                [
                    "==",
                    "0.1.0"
                ]
            ]
        },
        {
            "name": "opencv-python",
            "specs": []
        },
        {
            "name": "scikit-image",
            "specs": []
        },
        {
            "name": "pywavelets",
            "specs": []
        },
        {
            "name": "tensorflow_probability",
            "specs": [
                [
                    "==",
                    "0.14.1"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "1.19.2"
                ]
            ]
        },
        {
            "name": "ipykernel",
            "specs": []
        },
        {
            "name": "protobuf",
            "specs": [
                [
                    "==",
                    "3.20.3"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "1.4"
                ]
            ]
        }
    ],
    "lcname": "tensorflow-wavelets"
}
        
Elapsed time: 0.61646s