{"id":14958970,"url":"https://github.com/luca-parisi/hyper_sinh","last_synced_at":"2025-10-29T08:49:11.980Z","repository":{"id":183795006,"uuid":"336582414","full_name":"luca-parisi/hyper_sinh","owner":"luca-parisi","description":"hyper-sinh: An Accurate and Reliable Activation Function from Shallow to Deep Learning in TensorFlow, Keras, and PyTorch","archived":false,"fork":false,"pushed_at":"2024-09-12T22:41:15.000Z","size":37,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T03:01:31.451Z","etag":null,"topics":["activation-functions","cnn","cnn-classification","cnn-keras","cnn-model","deep-learning","deep-neural-networks","keras","keras-neural-networks","keras-tensorflow","machine-learning","machinelearning-python","pytorch","sinh","tensorflow","tensorflow-models","torch"],"latest_commit_sha":null,"homepage":"https://www.sciencedirect.com/science/article/pii/S2666827021000566","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luca-parisi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-06T16:29:01.000Z","updated_at":"2024-11-16T09:32:50.000Z","dependencies_parsed_at":"2024-09-24T13:31:15.081Z","dependency_job_id":"81a5a4c0-b905-4a6a-95cf-cbd7fe2d7eb5","html_url":"https://github.com/luca-parisi/hyper_sinh","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":"0.23076923076923073","last_synced_commit":"b85e01f0541323b7e9801786d98b89f229f421b7"},"previous_names":["luca-parisi/hyper_sinh"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luca-parisi%2Fhyper_sinh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luca-parisi%2Fhyper_sinh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luca-parisi%2Fhyper_sinh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luca-parisi%2Fhyper_sinh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luca-parisi","download_url":"https://codeload.github.com/luca-parisi/hyper_sinh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237999501,"owners_count":19399891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activation-functions","cnn","cnn-classification","cnn-keras","cnn-model","deep-learning","deep-neural-networks","keras","keras-neural-networks","keras-tensorflow","machine-learning","machinelearning-python","pytorch","sinh","tensorflow","tensorflow-models","torch"],"created_at":"2024-09-24T13:18:36.642Z","updated_at":"2025-10-24T16:30:33.412Z","avatar_url":"https://github.com/luca-parisi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hyper-sinh in TensorFlow, Keras, and PyTorch\n## An Accurate and Reliable Function from Shallow to Deep Learning\n\nThe **'hyper-sinh'** is a Python custom activation function available for both shallow and deep neural networks in TensorFlow, Keras, and PyTorch for Machine Learning- and Deep Learning-based classification. It is distributed under the [CC BY 4.0 license](http://creativecommons.org/licenses/by/4.0/).\n\nDetails on this function, implementation and validation against gold standard activation functions for both shallow and deep neural networks are available at the following paper: **[Parisi et al., 2021a](https://www.sciencedirect.com/science/article/pii/S2666827021000566)**. \n\n\n### Dependencies\n\nThe dependencies are included in the `environment.yml` file. \nRun the following command to install the required version of Python (v3.9.16) and all dependencies in a conda virtual \nenvironment (replace `\u003cenv_name\u003e` with your environment name):\n\n- `conda env create --name \u003cenv_name\u003e --file environment.yml`\n\n### Usage\n\nYou can use the custom `HyperSinh` activation function in Keras or PyTorch as a layer:\n\n#### Example of usage in a sequential model in Keras with a `HyperSinh` layer between a convolutional layer and a pooling layer\n\nEither\n\n```python\nmodel = models.Sequential()\nmodel.add(layers.Conv2D(32, (3, 3), input_shape=(32, 32, 3)))\nmodel.add(HyperSinh()) \nmodel.add(layers.MaxPooling2D((2, 2)))\n```\n\nor\n\n```python\nmodel = keras.Sequential(\n        keras.Input(shape=(32, 32, 3)),\n\n        layers.Conv2D(32, kernel_size=(3, 3)),\n        HyperSinh(),\n\n        layers.MaxPooling2D(pool_size=(2, 2)),\n    ]\n)\n```\n\n#### Example of usage in a sequential model in PyTorch with a `HyperSinh` layer between a convolutional layer and a pooling layer\n\n```python\nself.conv1 = nn.Conv2d(1, OUT_CHANNEL_CONV1, kernel_size=KERNEL_SIZE_CONV)\nself.hyper_sinh1 = HyperSinh()\nself.pool1 = nn.MaxPool2d(kernel_size=KERNEL_SIZE_MAX_POOL)\n```\n\n### Linting\n`isort` is used to ensure a consistent order of imports, whilst `autopep8` to ensure adherence of the codes to PEP-8, \nvia the following two commands respectively:\n\n- `isort \u003cfolder_name\u003e`\n- `autopep8 --in-place --recursive .`\n\n### Citation request\n\nIf you are using this function, please cite the papers by:\n* **[Parisi et al., 2020](https://arxiv.org/abs/2011.07661)**.\n* **[Parisi et al., 2021a](https://www.sciencedirect.com/science/article/pii/S2666827021000566)**.\n* **[Parisi et al., 2021b](https://www.wseas.org/multimedia/journals/computerresearch/2021/a025118-001(2021).pdf)**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluca-parisi%2Fhyper_sinh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluca-parisi%2Fhyper_sinh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluca-parisi%2Fhyper_sinh/lists"}