sagenetgw


Namesagenetgw JSON
Version 0.1.11 PyPI version JSON
download
home_pageNone
SummaryA Python package for gravitational wave analysis using neural networks
upload_time2025-07-12 12:38:33
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2025 Y Luo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords gravitational waves machine learning neural networks
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SageNetGW


## Overview

SageNet+ is an advanced Python package for emulating the stochastic
gravitational wave background (SGWB) spectra from inflation, extending
the SageNet framework described in Zhang et al. (2025). It leverages
deep learning models (LSTM, Transformer, CosmicNet2, or RNN)
and numerical solvers from stiffGWpy to predict the energy density spectrum
with high accuracy and computational efficiency.
SageNet+ supports a wide range of cosmological parameters and achieves a
~10,000-fold speedup over traditional numerical methods.

For more details, see https://github.com/YifangLuo/SageNet 
and https://github.com/bohuarolandli/stiffGWpy

## Installation

SageNet+ is available on PyPI and can be installed using pip:

```bash
pip install sagenetgw
```

### Dependencies

- Python 3.8+
- PyTorch (>=2.0.0)
- NumPy (>=1.20.0)
- scikit-learn (>=1.0.0)

## Quick Start

Below is a simple example to predict an SGWB spectrum using SageNet+:

```python
from sagenetgw.classes import GWPredictor
import numpy as np
from matplotlib import pyplot as plt

predictor = GWPredictor(
        model_type='Transformer',
        device="cpu"
    )

prediction = predictor.predict({
    "r":3.9585109e-05, 
    "n_t":1.0116972, 
    "kappa10":110.42477, 
    "T_re":0.17453859, 
    "DN_re":39.366618,
    "Omega_bh2":0.0223828, 
    "Omega_ch2":0.1201075, 
    "H0":67.32117, 
    "A_s":2.100549e-9
})
pred_coords = np.column_stack((prediction['f'], prediction['log10OmegaGW']))
plt.plot(pred_coords[:, 0], pred_coords[:, 1], '--', color="royalblue", marker='.')
```

Ensure CUDA is installed if using GPU acceleration (by `device='cuda'`).


## Parameter Ranges

The following cosmological parameters are supported:

| Parameter | Range                            | Scale       |
|-----------|----------------------------------|-------------|
| r         | [1e-40, 1]                       | Logarithmic |
| n_t       | [-1, 6]                          | Linear      |
| kappa10   | [1e-7, 1e3]                      | Logarithmic |
| T_re      | [1e-3, 1e7] GeV                  | Logarithmic |
| DN_re     | [0, 40]                          | Linear      |
| Omega_bh2 | [0.005, 0.1]                     | Linear      |
| Omega_ch2 | [0.001, 0.99]                    | Linear      |
| H0        | [20, 100] km/s/Mpc               | Linear      |
| A_s       | [exp(1.61)/1e10, exp(3.91)/1e10] | Linear      |

## Citation

If you use SageNet+ in your research, please cite:

> Zhang, F., Luo, Y., Li, B., et al. (2025). SageNet: Fast Neural Network Emulation of the Stiff-amplified Gravitational
> Waves from Inflation. arXiv:2504.04054.

## License

SageNet+ is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sagenetgw",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "gravitational waves, machine learning, neural networks",
    "author": null,
    "author_email": "Yifang Luo <luoyifang@bupt.cn>",
    "download_url": null,
    "platform": null,
    "description": "# SageNetGW\n\n\n## Overview\n\nSageNet+ is an advanced Python package for emulating the stochastic\ngravitational wave background (SGWB) spectra from inflation, extending\nthe SageNet framework described in Zhang et al. (2025). It leverages\ndeep learning models (LSTM, Transformer, CosmicNet2, or RNN)\nand numerical solvers from stiffGWpy to predict the energy density spectrum\nwith high accuracy and computational efficiency.\nSageNet+ supports a wide range of cosmological parameters and achieves a\n~10,000-fold speedup over traditional numerical methods.\n\nFor more details, see https://github.com/YifangLuo/SageNet \nand https://github.com/bohuarolandli/stiffGWpy\n\n## Installation\n\nSageNet+ is available on PyPI and can be installed using pip:\n\n```bash\npip install sagenetgw\n```\n\n### Dependencies\n\n- Python 3.8+\n- PyTorch (>=2.0.0)\n- NumPy (>=1.20.0)\n- scikit-learn (>=1.0.0)\n\n## Quick Start\n\nBelow is a simple example to predict an SGWB spectrum using SageNet+:\n\n```python\nfrom sagenetgw.classes import GWPredictor\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\npredictor = GWPredictor(\n        model_type='Transformer',\n        device=\"cpu\"\n    )\n\nprediction = predictor.predict({\n    \"r\":3.9585109e-05, \n    \"n_t\":1.0116972, \n    \"kappa10\":110.42477, \n    \"T_re\":0.17453859, \n    \"DN_re\":39.366618,\n    \"Omega_bh2\":0.0223828, \n    \"Omega_ch2\":0.1201075, \n    \"H0\":67.32117, \n    \"A_s\":2.100549e-9\n})\npred_coords = np.column_stack((prediction['f'], prediction['log10OmegaGW']))\nplt.plot(pred_coords[:, 0], pred_coords[:, 1], '--', color=\"royalblue\", marker='.')\n```\n\nEnsure CUDA is installed if using GPU acceleration (by `device='cuda'`).\n\n\n## Parameter Ranges\n\nThe following cosmological parameters are supported:\n\n| Parameter | Range                            | Scale       |\n|-----------|----------------------------------|-------------|\n| r         | [1e-40, 1]                       | Logarithmic |\n| n_t       | [-1, 6]                          | Linear      |\n| kappa10   | [1e-7, 1e3]                      | Logarithmic |\n| T_re      | [1e-3, 1e7] GeV                  | Logarithmic |\n| DN_re     | [0, 40]                          | Linear      |\n| Omega_bh2 | [0.005, 0.1]                     | Linear      |\n| Omega_ch2 | [0.001, 0.99]                    | Linear      |\n| H0        | [20, 100] km/s/Mpc               | Linear      |\n| A_s       | [exp(1.61)/1e10, exp(3.91)/1e10] | Linear      |\n\n## Citation\n\nIf you use SageNet+ in your research, please cite:\n\n> Zhang, F., Luo, Y., Li, B., et al. (2025). SageNet: Fast Neural Network Emulation of the Stiff-amplified Gravitational\n> Waves from Inflation. arXiv:2504.04054.\n\n## License\n\nSageNet+ is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 Y Luo\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.",
    "summary": "A Python package for gravitational wave analysis using neural networks",
    "version": "0.1.11",
    "project_urls": {
        "Homepage": "https://github.com/luoyifang/sagenet",
        "Repository": "https://github.com/luoyifang/sagenet"
    },
    "split_keywords": [
        "gravitational waves",
        " machine learning",
        " neural networks"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9854f4d2ff92588b653314c7527fd959a0de09fb781d208e578682d29e06ae05",
                "md5": "2aa39a0ebe7aa954651b6eb70cb5462e",
                "sha256": "0063c66ade65f8e39fe8cbaf2e7662cbfe3c4413e1ef95e7532eb5cb88fcae9f"
            },
            "downloads": -1,
            "filename": "sagenetgw-0.1.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2aa39a0ebe7aa954651b6eb70cb5462e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 21202777,
            "upload_time": "2025-07-12T12:38:33",
            "upload_time_iso_8601": "2025-07-12T12:38:33.482744Z",
            "url": "https://files.pythonhosted.org/packages/98/54/f4d2ff92588b653314c7527fd959a0de09fb781d208e578682d29e06ae05/sagenetgw-0.1.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-12 12:38:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "luoyifang",
    "github_project": "sagenet",
    "github_not_found": true,
    "lcname": "sagenetgw"
}
        
Elapsed time: 0.63453s