deepxde

deepxde.callbacks module

deepxde.config module

deepxde.config.default_float()[source]

Returns the default float type, as a string.

deepxde.config.disable_xla_jit()[source]

Disables just-in-time compilation with XLA.

  • For backend TensorFlow 1.x, by default, compiles with XLA when running on GPU. XLA compilation can only be enabled when running on GPU.

  • For backend TensorFlow 2.x, by default, compiles with XLA when running on GPU. If compilation with XLA makes your code slower on GPU, in addition to calling disable_xla_jit, you may simultaneously try XLA with auto-clustering via

    $ TF_XLA_FLAGS=–tf_xla_auto_jit=2 path/to/your/program

  • Backend JAX always uses XLA.

  • Backends PyTorch and PaddlePaddle do not support XLA.

This is equivalent with enable_xla_jit(False).

deepxde.config.enable_xla_jit(mode=True)[source]

Enables just-in-time compilation with XLA.

  • For backend TensorFlow 1.x, by default, compiles with XLA when running on GPU. XLA compilation can only be enabled when running on GPU.

  • For backend TensorFlow 2.x, by default, compiles with XLA when running on GPU. If compilation with XLA makes your code slower on GPU, in addition to calling disable_xla_jit, you may simultaneously try XLA with auto-clustering via

    $ TF_XLA_FLAGS=–tf_xla_auto_jit=2 path/to/your/program

  • Backend JAX always uses XLA.

  • Backends PyTorch and PaddlePaddle do not support XLA.

Parameters:

mode (bool) – Whether to enable just-in-time compilation with XLA (True) or disable just-in-time compilation with XLA (False).

deepxde.config.set_default_autodiff(value)[source]

Sets the default automatic differentiation mode.

The default automatic differentiation uses reverse mode.

Parameters:

value (String) – ‘reverse’ or ‘forward’.

deepxde.config.set_default_float(value)[source]

Sets the default float type.

The default floating point type is ‘float32’.

Parameters:

value (String) – ‘float16’, ‘float32’, or ‘float64’.

deepxde.config.set_parallel_scaling(scaling_mode)[source]

Sets the scaling mode for data parallel acceleration. Weak scaling involves increasing the problem size proportionally with the number of processors, while strong scaling involves keeping the problem size fixed and increasing the number of processors.

Parameters:

scaling_mode (str) – Whether ‘weak’ or ‘strong’

deepxde.config.set_random_seed(seed)[source]

Sets all random seeds for the program (Python random, NumPy, and backend), and configures the program to run deterministically.

You can use this to make the program fully deterministic. This means that if the program is run multiple times with the same inputs on the same hardware, it will have the exact same outputs each time. This is useful for debugging models, and for obtaining fully reproducible results.

  • For backend TensorFlow 2.x: Results might change if you run the model several times in the same terminal.

Warning

Note that determinism in general comes at the expense of lower performance and so your model may run slower when determinism is enabled.

Parameters:

seed (int) – The desired seed.

deepxde.losses module

deepxde.metrics module

deepxde.model module