You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Capse.jl` is a Julia package designed to emulate the computation of the CMB Angular Power Spectrum, with a speedup of several orders of magnitude.
39
+
`Capse.jl` is a Julia package designed to emulate the computation of the CMB Angular Power Spectrum, with a speedup of several orders of magnitude compared to standard codes.
27
40
28
41
## Installation
29
42
@@ -40,7 +53,7 @@ In order to be able to use `Capse.jl`, there two major steps that need to be per
40
53
- Instantiating the emulators, e.g. initializing the Neural Network, its weight and biases and the quantities employed in pre and post-processing
41
54
- Use the instantiated emulators to retrieve the spectra
42
55
43
-
In the reminder of this section we are showing how this can be done.
56
+
In the reminder of this section we are showing how to do this.
where `weights_folder` is the path to the folder containing the files required to build up the network. Some of the trained emulators can be found on [Zenodo](https://zenodo.org/record/8187935) and we plan to release more of them there in the future.
54
67
55
-
It is possible to pass an additional argument to the previous function, which is used to choose between the two NN backed now available:
68
+
It is possible to pass an additional argument to the previous function, which is used to choose between the two NN backend now available:
56
69
57
70
-[SimpleChains](https://github.com/PumasAI/SimpleChains.jl), which is taylored for small NN running on a CPU
58
-
-[Lux](https://github.com/LuxDL/Lux.jl), which can run on a GPU
71
+
-[Lux](https://github.com/LuxDL/Lux.jl), which can run both on CPUs and GPUs
59
72
60
73
`SimpleChains.jl` is faster expecially for small NN on the CPU. If you wanna use something running on a GPU, you should use `Lux.jl`, which can be done adding an additional argument to the `load_emulator` function, `Capse.LuxEmulator`
61
74
@@ -69,17 +82,20 @@ Each trained emulator should be shipped with a description within the JSON file.
69
82
Capse.get_emulator_description(Cℓ_emu)
70
83
```
71
84
72
-
After loading a trained emulator, feed it some input parameters `x` in order to get the emulated $C_\ell$'s
85
+
!!! warning
86
+
87
+
Cosmological parameters must be fed to `Capse.jl` with **arrays**. It is the user
88
+
responsability to check the right ordering, by reading the output of the
89
+
`get_emulator_description` method.
90
+
91
+
After loading a trained emulator, feed it some input parameters `x` in order to get the
92
+
emulated $C_\ell$'s
73
93
74
94
```julia
75
95
x =rand(6) # generate some random input
76
96
Capse.get_Cℓ(x, Cℓ_emu) #compute the Cℓ's
77
97
```
78
98
79
-
!!! warning
80
-
81
-
In this moment the API is **not** stable: we need to pass the input cosmological parameters in an hardcoded way. We are working to add a more stable and flexible API.
82
-
83
99
Using `SimpleChains.jl`, we obtain a mean execution time of 45 microseconds
`SimpleChains.jl` is about 2 times faster than `Lux.jl` and they give the same result up to floating point precision.
96
112
97
-
This benchmarks have been performed locally, with a 12th Gen Intel® Core™ i7-1260P.
113
+
These benchmarks have been performed locally, with a 12th Gen Intel® Core™ i7-1260P.
98
114
99
115
Considering that a high-precision settings calculation performed with [`CAMB`](https://github.com/cmbant/CAMB) on the same machine requires around 60 seconds, `Capse.jl` is 5-6 order of magnitudes faster.
100
116
101
117
### Authors
102
118
103
-
- Marco Bonici, INAF - Institute of Space Astrophysics and Cosmic Physics (IASF), Milano
119
+
- Marco Bonici, PostDoctoral researcher at Waterloo Center for Astrophysics
104
120
- Federico Bianchini, PostDoctoral researcher at Stanford
105
121
- Jaime Ruiz-Zapatero, PhD Student at Oxford
122
+
- Marius Millea, Researcher at UC Davis and Berkeley Center for Cosmological Physics
106
123
107
124
## Contributing
108
125
109
-
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
126
+
Pull requests are welcome. For major changes, please open an issue first to discuss what you
127
+
would like to change.
110
128
111
129
Please make sure to update tests as appropriate.
112
130
113
131
### License
114
132
115
133
`Capse.jl` is licensed under the MIT "Expat" license; see
116
-
[LICENSE](https://github.com/CosmologicalEmulators/Effort.jl/blob/main/LICENSE) for
117
-
the full license text.
134
+
[LICENSE](https://github.com/CosmologicalEmulators/Effort.jl/blob/main/LICENSE) for the full
@test_logs (:warn, "We do not know which parameters were included in the emulators training space. Use this trained emulator with caution!") Capse.get_emulator_description(capse_emu)
40
+
@test_logs (:warn, "No emulator description present!") Capse.get_emulator_description(capse_emu)
0 commit comments