Comments (6)
Give a look, @TarikKaanKoc, in the commit ef2bc63 of the branch fix/pytorch-residuals-module
, apparently it is a solution.
In addition to the preference for PyTorch, I think the factory function which was being used was not the best solution, since we cannot guarantee the entire source code can be reused with different backends as JAX and Apache MXNet, just changing the importing source.
from simulai.
Hi. Let me know if I understand properly. Have you flawlessly build the docs locally, but it is not being updated in RTD ?
from simulai.
Hi. Let me know if I understand properly. Have you flawlessly build the docs locally, but it is not being updated in RTD ?
Hi, I will check now. I'm sorry I wasn't available because of the earthquake.
from simulai.
Difficulty documenting class within function
When attempting to generate documentation with Sphinx, I am having trouble documenting a class that is defined within a function. The current setup is as follows:
def SymbolicOperator(
expressions: list = None,
input_vars: list = None,
output_vars: list = None,
function: callable = None,
gradient: callable = None,
keys: str = None,
inputs_key: str = None,
processing: str = "serial",
device: str = "cpu",
engine: str = "torch",
auxiliary_expressions: list = None,
constants: dict = None,
) -> object:
"""
Constructs a tensor operator using symbolic expressions using PyTorch or any other supported engine.
Args:
expressions (list, optional): List of expressions representing the operator. Defaults to None.
input_vars (list, optional): List of input variables. Defaults to None.
output_vars (list, optional): List of output variables. Defaults to None.
function (callable, optional): A callable that represents the evaluation of the tensor operator. Defaults to None.
gradient (callable, optional): A callable that represents the gradient evaluation of the tensor operator. Defaults to None.
keys (str, optional): The keys for accessing the inputs in the input dictionary. Defaults to None.
inputs_key (str, optional): The key for accessing the input data in the input dictionary. Defaults to None.
processing (str, optional): The processing method to be used during the evaluation of the tensor operator. Defaults to 'serial'.
device (str, optional): The device to be used during the evaluation of the tensor operator. Can be either 'cpu' or 'gpu'. Defaults to 'cpu'.
engine (str, optional): The symbolic computation engine to be used. Currently supported engines are 'torch' and 'numpy'. Defaults to 'torch'.
auxiliary_expressions (list, optional): Additional expressions that are needed to evaluate the tensor operator. Defaults to None.
constants (dict, optional): Constants that are required during the evaluation of the tensor operator. Defaults to None.
Returns:
object: An instance of the SymbolicOperatorClass.
"""
class SymbolicOperatorClass(torch.nn.Module if engine == "torch" else object):
Difficulty documenting a class defined within a function
I am having trouble documenting a class that is defined within a function when generating documentation with Sphinx. To properly document a class with Sphinx, it should be defined outside the function and then its documentation should be written in a separate documentation block. This way, Sphinx can generate separate documentation for both the function and the class.
from simulai.
How about we fix this or leave it as it is? @Joao-L-S-Almeida
from simulai.
Hi. @TarikKaanKoc. This implementation uses a factory function to return the class SymbolicOperator in order to support the usage of others backends than PyTorch. However, as we are currently more interested in using PyTorch as foundation (and, certainly, there are better ways to support multiple engines) I will make it a simple class in the branch associated with this issue.
from simulai.
Related Issues (20)
- Filtering losses in PINNs
- Model Checkpointing is missing. HOT 1
- Batchwise optimization takes longer times than expected to run HOT 3
- SymbolicOperator should support to receive def functions. HOT 1
- Creating units tests
- Replicating the structure of PIRMSE to OPIRMSE
- Doctrings for Optimization, SymbolicOperator and Losses HOT 1
- Trainable parameters are not being updated
- Causality preserving must be generic and externally defined.
- Inputs keys for Physics-Informed Neural Operators could contain variables from any branch
- Integration with SciPy optimizers
- Batch-normalization must be considered on CNN architectures.
- Is the SciPyInterface really communicating gradients to the torch.nn.Module objects ?
- Verbose printing is not properly operating
- Python 3.11 support HOT 4
- Python version limitation HOT 2
- MultiScaleAutoencoder also should support vanilla autoencoders
- SPFile must also save class defined template methods.
- NIF is not converging.
- Wavelet activation is not running on CUDA devices
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simulai.