# Pipeline for gradients ascent

**URL:** <https://pyfr.discourse.group/t/pipeline-for-gradients-ascent/1258>\
**Category:** Uncategorised\
**Created:** [13 May 2025 13:51 UTC](https://pyfr.discourse.group/t/pipeline-for-gradients-ascent/1258 "2025-05-13T13:51:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frankx9](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Post date:** [13 May 2025 13:51 UTC](https://pyfr.discourse.group/t/pipeline-for-gradients-ascent/1258/1 "2025-05-13T13:51:18Z")

</div>

Hi,

do you have a pipeline to compute gradients with the ascent plugin?

I tried the following but with no success

```auto
field-velocity = u, v
pipeline-grad = [{'type': 'gradient', 'field': 'velocity', 'output-name': 'gradvel'}]
scene-gradvel = {'type': 'pseudocolor',
                        'min-value': 0, 'max-value': 25, 'color-table_name': 'Cool to Warm',
                        'field': 'gradvel', 'pipeline': 'grad',
                    'render-1': {'image-name': 'gradvel/{t:4.10f}'}}

```

Best

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [14 May 2025 21:00 UTC](https://pyfr.discourse.group/t/pipeline-for-gradients-ascent/1258/2 "2025-05-14T21:00:50Z")

</div>

In general you are better off using the gradients provided by PyFR. These will typically be more accurate than those computed by Ascent.

With that said I am unsure how your scene works as gradvel is a tensor (matrix). You probably need to add a magnitude somewhere.

Regards, Freddie.
