Skip to content
Snippets Groups Projects
index.rst 2.98 KiB

pystencils-autodiff

This is the documentation of pystencils-autodiff.

This document assumes that you are already familiar with pystencils. If not, here is a good tutorial to start.

Installation of this Auto-Diff Extension

Install via pip :

pip install pystencils-autodiff

or if you downloaded this repository using:

pip install -e .

Then, you can access the submodule pystencils.autodiff.

import pystencils.autodiff

Usage

Create a :class:`pystencils.AssignmentCollection` with pystencils:

You can then obtain the corresponding backward assignments:

You can see the derivatives with respective to the two inputs multiplied by the gradient diffz_C of the output z_C.

You can also use the class :class:`.autodiff.AutoDiffOp` to obtain both the assignments (if you are curious) and auto-differentiable operations for Tensorflow...

... or Torch:

Contents

Indices and tables

  • :ref:`genindex`
  • :ref:`modindex`
  • :ref:`search`