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
{{ message }}
Repository navigation
Remaining To-Do for the new documentation website #1536
As mentioned, I can help with adding examples to docstrings for API reference. If you think it makes sense, I'll do a couple of them, and a PR and we can discuss on top of that. Do you have any standardized format it mind that I can take as an example?
I was referring to the introductory example in the getting started documentation (the simulator + inference workflow).
I made a few targeted changes to improve readability and clarity for first-time users:
Refactored the simulator into a clearer multi-line function with comments explaining what it does
Made the data generation flow more explicit (theta → simulator(theta) → x) so the pipeline is easier to follow
Improved comments around the inference step to better explain what is happening conceptually (e.g., initializing and training the neural density estimator)
Slightly simplified some of the surrounding explanation to make it easier to read without losing meaning
Updated the installation phrasing to be more consistent ("using pip")
Regarding the unicode variable, that makes sense — I can keep θ as-is and focus only on structural and explanatory improvements.
The goal is mainly to make the first example easier to follow for new users encountering sbi for the first time.
Would you like me to proceed with these changes as a PR, or should I narrow the scope further?
Hi! I noticed that the FCEmbedding class in the API reference does not currently show a usage example.
I propose adding a short example to its docstring demonstrating how to instantiate FCEmbedding, pass a batch of input tensors through the network, and check the output shape. This would help users understand how to use the embedding network without needing to work out the usage from the implementation.
To test the change, I would run the example with PyTorch to verify that it executes successfully and produces an output with the expected shape. I would also build the documentation locally to confirm that the example renders correctly in the API reference.
I checked the current pull requests for FCEmbedding and did not find one specifically focused on adding a usage example. Since the team is working through the remaining documentation tasks in this issue, I wanted to describe this specific improvement here before proceeding.
Hi! Just following up on my suggestion for adding a usage example to the FCEmbedding API docstring. Could you please let me know if this approach would be useful and whether you'd be happy for me to open a PR for it? I'd be glad to make any adjustments based on your feedback. Thank you!
Hi! While reviewing CNNEmbedding in sbi/neural_nets/embedding_nets/cnn.py, I noticed that two parameter names in the __init__ docstring don't match the constructor signature:
num_cnn_layers should be num_conv_layers.
pool_size should be pool_kernel_size.
I'd like to correct these descriptions and update the related assertion message that still refers to num_cnn_layers. This would make the documentation and error message consistent with the actual API.
I checked the open documentation PR #1987 and didn't find cnn.py among its changed files. Would this be a useful, focused contribution?
Hi! I'd also like to propose adding a small, runnable Examples section to the CNNEmbedding class docstring in sbi/neural_nets/embedding_nets/cnn.py.
The example would demonstrate initializing the embedding network, passing a batch of channel-first images through it, and checking the resulting embedding shape. I'd follow the project's Google-style docstring format and test the example before submitting a PR.
Would this be a useful addition? I haven't made any changes yet.
@Ashwini8686 thanks for spotting the wrong argument names in the CNNEmbedding docstring and error messages, and sorry for the late answer. We found more to fix in these embedding nets at the same time, so I included your fix in PR #2113 and credited you there.
Your proposals for usage examples in the FCEmbedding and CNNEmbedding docstrings are welcome. Please open one small follow-up PR for both. Keep each example short: build the net, pass one batch through it, and show the output shape. Please check that each example runs.
Activity
jorobledo commentedon Mar 27, 2025
Hi Micha,
As mentioned, I can help with adding examples to docstrings for API reference. If you think it makes sense, I'll do a couple of them, and a PR and we can discuss on top of that. Do you have any standardized format it mind that I can take as an example?
michaeldeistler commentedon Mar 27, 2025
Yes, anytime!
Something like this would be nice:
Thanks a ton!
jorobledo commentedon Mar 27, 2025
Can it be that the documentation on how to contribute is outdated? I built it using the make file, but it's not what is mentioned here.
jorobledo commentedon Mar 27, 2025
Something like this looks good? I understand we want simple standalone examples. Maybe not explore all methods? Maybe not explore any?
https://github.com/jorobledo/sbi/blob/42c5d7c27e5e857c62fc1bdbfaf9830d478cccfe/sbi/utils/torchutils.py#L276-L328
Also, are examples of methods necessary?
https://github.com/jorobledo/sbi/blob/42c5d7c27e5e857c62fc1bdbfaf9830d478cccfe/sbi/utils/torchutils.py#L362-L377
I don't see them in the new documentation format. What do you think?
Screenshot on how I see it (Methods don't show extended docstrings)
jorobledo commentedon Mar 31, 2025
@michaeldeistler suggestions on these comments?
Should I PR to main for documentation changes?
michaeldeistler commentedon Mar 31, 2025
Hi @jorobledo!
Sorry for the slow response! The example looks great! No need to explore all methods, I like how you solved it. Please open a PR. Thanks a ton!
Pratyusha-DS13 commentedon Mar 22, 2026
Hi! I was going through the documentation and noticed that the introductory example could be improved for better readability and accessibility.
Some specific ideas:
Would this fit under this To-Do, or would you prefer a separate issue for this?
I'd be happy to work on it!
janfb commentedon Mar 23, 2026
Hi @Pratyusha-DS13 thanks for offering your help here!
Can you be more specific about which intro example you want to edit?
Regarding your points: I think the unicode variable is actually intended for readability in the tutorial setting.
Pratyusha-DS13 commentedon Mar 23, 2026
Thanks for the clarification!
I was referring to the introductory example in the getting started documentation (the simulator + inference workflow).
I made a few targeted changes to improve readability and clarity for first-time users:
theta → simulator(theta) → x) so the pipeline is easier to followRegarding the unicode variable, that makes sense — I can keep
θas-is and focus only on structural and explanatory improvements.The goal is mainly to make the first example easier to follow for new users encountering sbi for the first time.
Would you like me to proceed with these changes as a PR, or should I narrow the scope further?
janfb commentedon Oct 8, 2026
@Pratyusha-DS13 sorry that your question went unanswered for so long, and thanks for the detailed list.
We will work on the remaining items of this list within the team, including the getting-started example. So please don't open a PR for it.
Thanks again for offering your help, Jan
Ashwini8686 commentedon Oct 18, 2026
Hi! I noticed that the FCEmbedding class in the API reference does not currently show a usage example.
I propose adding a short example to its docstring demonstrating how to instantiate FCEmbedding, pass a batch of input tensors through the network, and check the output shape. This would help users understand how to use the embedding network without needing to work out the usage from the implementation.
To test the change, I would run the example with PyTorch to verify that it executes successfully and produces an output with the expected shape. I would also build the documentation locally to confirm that the example renders correctly in the API reference.
I checked the current pull requests for FCEmbedding and did not find one specifically focused on adding a usage example. Since the team is working through the remaining documentation tasks in this issue, I wanted to describe this specific improvement here before proceeding.
Ashwini8686 commentedon Oct 19, 2026
Hi! Just following up on my suggestion for adding a usage example to the
FCEmbeddingAPI docstring. Could you please let me know if this approach would be useful and whether you'd be happy for me to open a PR for it? I'd be glad to make any adjustments based on your feedback. Thank you!Ashwini8686 commentedon Oct 19, 2026
Hi! While reviewing
CNNEmbeddinginsbi/neural_nets/embedding_nets/cnn.py, I noticed that two parameter names in the__init__docstring don't match the constructor signature:num_cnn_layersshould benum_conv_layers.pool_sizeshould bepool_kernel_size.I'd like to correct these descriptions and update the related assertion message that still refers to
num_cnn_layers. This would make the documentation and error message consistent with the actual API.I checked the open documentation PR #1987 and didn't find
cnn.pyamong its changed files. Would this be a useful, focused contribution?Ashwini8686 commentedon Oct 19, 2026
Hi! I'd also like to propose adding a small, runnable
Examplessection to theCNNEmbeddingclass docstring insbi/neural_nets/embedding_nets/cnn.py.The example would demonstrate initializing the embedding network, passing a batch of channel-first images through it, and checking the resulting embedding shape. I'd follow the project's Google-style docstring format and test the example before submitting a PR.
Would this be a useful addition? I haven't made any changes yet.
janfb commentedon Oct 29, 2026
@Ashwini8686 thanks for spotting the wrong argument names in the
CNNEmbeddingdocstring and error messages, and sorry for the late answer. We found more to fix in these embedding nets at the same time, so I included your fix in PR #2113 and credited you there.Your proposals for usage examples in the
FCEmbeddingandCNNEmbeddingdocstrings are welcome. Please open one small follow-up PR for both. Keep each example short: build the net, pass one batch through it, and show the output shape. Please check that each example runs.thanks again, Jan
Ashwini8686 commentedon Oct 29, 2026
Hi !
I've opened the follow-up PR #2120 with usage examples for both
FCEmbeddingandCNNEmbedding, as you suggested.I tested both examples and ran the relevant embedding network tests. The lint and formatting checks also passed.
Whenever you have time, could you please review it? Thank you for your guidance!
janfb commentedon Nov 19, 2026
@Ashwini8686 thanks for adding the
FCEmbeddingandCNNEmbeddingexamples, PR #2120 is merged now.We will take care of the remaining items of this list internally, so please don't open PRs for them.
thanks, Jan