Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polarised proton fits #1979

Merged
merged 97 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
3eedbb7
start porting changes required for polarised fits
Radonirinaunimi Mar 4, 2024
3008640
undo accidental changes in modules
Radonirinaunimi Mar 4, 2024
8bb220a
undo further changes
Radonirinaunimi Mar 4, 2024
358bac6
fix computation of unpol bound and positivity operations
Radonirinaunimi Mar 5, 2024
83d06a0
add template runcard for polarised fits
Radonirinaunimi Mar 5, 2024
b8ccf4f
update template card
Radonirinaunimi Mar 5, 2024
84c6ace
made some fixes (related to multi-replicas) from CR
Radonirinaunimi Mar 6, 2024
71da9af
adopt new way of doing convolutions
Radonirinaunimi Mar 6, 2024
90e6638
make new convolution work
Radonirinaunimi Mar 6, 2024
d32ec09
revert back positional argument for the time being
Radonirinaunimi Mar 6, 2024
615fc2e
add polarized comparefits report
Radonirinaunimi Mar 6, 2024
67f5aae
clean up a bit POS convolution
Radonirinaunimi Mar 6, 2024
eaff52a
simplify sum rules in polarized reports
Radonirinaunimi Mar 6, 2024
de87db8
remove unrelated changes to POS metadata
Radonirinaunimi Mar 7, 2024
d5b337b
change default ranges in PDF plots of reports
Radonirinaunimi Mar 7, 2024
2abd122
add option to plot correlated uncertainties of partial integrated distr.
Radonirinaunimi Mar 7, 2024
18dcdad
add correlated spin moment plots to report
Radonirinaunimi Mar 7, 2024
1b6beb3
update the way in which unpol bound is parsed
Radonirinaunimi Mar 7, 2024
dd5cd53
update the runcard accordingly
Radonirinaunimi Mar 7, 2024
16c8041
deprecate old evolven3fit with new one
Radonirinaunimi Mar 7, 2024
a9981ac
revert the default behavior of pol.md
Radonirinaunimi Mar 7, 2024
9b5e312
remove deprecated checks
Radonirinaunimi Mar 7, 2024
518ff5e
start adding the regression test
Radonirinaunimi Mar 7, 2024
2e4da99
add documentation for running polarized fits
Radonirinaunimi Mar 8, 2024
97f1742
reflect changes from hyperopt parallel
Radonirinaunimi Mar 8, 2024
35e4c91
propagate is_polarized attr from pineparser
Radonirinaunimi Mar 8, 2024
4f57d19
deactivate regression for the time being
Radonirinaunimi Mar 8, 2024
71ff771
fix issues when checking polarised key from FKs
Radonirinaunimi Mar 8, 2024
938ebac
fix tests by extending _fake_FKTableData
Radonirinaunimi Mar 8, 2024
c26e112
Merge branch 'master' into nnpdfpol
Radonirinaunimi Mar 9, 2024
c286bf0
improve plotting of partial correlated moments
Radonirinaunimi Mar 9, 2024
3ac781a
change paradigm in enforcing polarised positivity boundary conditions
Radonirinaunimi Mar 9, 2024
87eaa6d
update runcard accordingly
Radonirinaunimi Mar 9, 2024
db80734
remove previous occurences of pos_bound
Radonirinaunimi Mar 9, 2024
76440c4
fixed tiny typos
Radonirinaunimi Mar 10, 2024
00346a4
fix parameters in test_layers
Radonirinaunimi Mar 10, 2024
d57c56c
fixed report when including positivity boundary plots
Radonirinaunimi Mar 11, 2024
c41c956
fixed scale when plotting Positivity Boundary conditions
Radonirinaunimi Mar 11, 2024
c0125ed
add check to unpolarized BC at vp-setupfit level
Radonirinaunimi Mar 11, 2024
1b660a8
fix tiny typo in the documentation
Radonirinaunimi Mar 11, 2024
13f6aa4
re-activate polarized regression test
Radonirinaunimi Mar 11, 2024
1eb11df
Apply suggestions from code review
Radonirinaunimi Mar 13, 2024
db17740
offload computations of POS BC to vp.convolution
Radonirinaunimi Mar 13, 2024
b575ea1
add tests for operations
Radonirinaunimi Mar 13, 2024
043e974
rename and completely order operations
Radonirinaunimi Mar 13, 2024
636ae79
fixed test_backend accordingly
Radonirinaunimi Mar 13, 2024
0955010
pass only one list into the observable computation
Radonirinaunimi Mar 13, 2024
10466fa
quite some refactors
Radonirinaunimi Mar 13, 2024
173c3ec
remove fitbasis from test
Radonirinaunimi Mar 13, 2024
9030a38
fixes some namings here and there
Radonirinaunimi Mar 14, 2024
82cefa3
simplifies further checks for BC computations
Radonirinaunimi Mar 14, 2024
1de5a3c
fixes again test due to renaming
Radonirinaunimi Mar 14, 2024
a28b133
minor corrections in the docstrings
Radonirinaunimi Mar 14, 2024
0c00cb0
significantly improve the polarized plottings
Radonirinaunimi Mar 14, 2024
0c15938
fixes paging in report
Radonirinaunimi Mar 14, 2024
50800f3
Merge branch 'master' into nnpdfpol
Radonirinaunimi Mar 15, 2024
e6fbdbb
further modifications to plotting
Radonirinaunimi Mar 17, 2024
90404fe
fixed major bug in POS Boundary Condition
Radonirinaunimi Mar 19, 2024
6ee6e1b
fixed issues that also affects the unpolarized POS
Radonirinaunimi Mar 24, 2024
2e744aa
rename function to be more generic
Radonirinaunimi Mar 26, 2024
fa96f1d
fix conflicts in operations
Radonirinaunimi Mar 27, 2024
0b083dc
Merge branch 'master' into nnpdfpol
Radonirinaunimi Mar 28, 2024
405e965
Merge branch 'master' into nnpdfpol
Radonirinaunimi Mar 28, 2024
4fddd50
fix example runcard to use updated names
Radonirinaunimi Mar 28, 2024
c3c97ed
remove completely pseudodata POS trials for polarized data
Radonirinaunimi Mar 29, 2024
3d20c17
remove the strict need for RELU in LM
Radonirinaunimi Apr 1, 2024
3392c4c
various tiny fixes on documentations
Radonirinaunimi Apr 1, 2024
8d1455d
fix dataset namings in regression
Radonirinaunimi Apr 2, 2024
f6b106c
Merge branch 'master' into nnpdfpol
Radonirinaunimi Apr 2, 2024
84a8ed0
final minor fixes in plottings
Radonirinaunimi Apr 2, 2024
2b0d8ca
Automatically regenerated regressions from PR 1979, branch nnpdfpol.
Apr 2, 2024
66ce7d8
add tests to test_fit
Radonirinaunimi Apr 2, 2024
82743d8
Fix regression fit test for polarized
Radonirinaunimi Apr 3, 2024
6321f08
Merge branch 'master' into nnpdfpol
Radonirinaunimi Apr 4, 2024
0e9c39f
go through the documentation one last time
Radonirinaunimi Apr 4, 2024
2f51e40
fix rng seed for TSR sum rules
Radonirinaunimi Apr 4, 2024
6bd4088
fix weights names in regression tests
Radonirinaunimi Apr 15, 2024
9ef946d
remove unwanted folder
Radonirinaunimi Apr 15, 2024
77b6f25
regenerate files from virtual machine
Radonirinaunimi Apr 15, 2024
8966b14
push forgotten commit
Radonirinaunimi Apr 15, 2024
412f8f8
various adjustments
Radonirinaunimi Apr 15, 2024
b29956f
use nnseed as the sr seed for TSR ; update weights, use double-preci…
scarlehoff Apr 16, 2024
47a077f
add test for sum_rules=TSR
scarlehoff Apr 16, 2024
f064628
Automatically regenerated regressions from PR 2053, branch regenerate…
Apr 16, 2024
992784b
Merge pull request #2053 from NNPDF/regenerate_test_pol
Radonirinaunimi Apr 16, 2024
aeb2a96
Merge branch 'master' into nnpdfpol
Radonirinaunimi Apr 16, 2024
29dd4fc
Apply suggestions from code review
Radonirinaunimi Apr 17, 2024
88a7b25
fix plotting of boundary conditions
Radonirinaunimi Apr 17, 2024
53fa696
address most/all of the review comments
Radonirinaunimi Apr 17, 2024
6edffdb
this does seem to do the joob
Radonirinaunimi Apr 17, 2024
9a8a9dd
Merge branch 'master' into nnpdfpol
Radonirinaunimi Apr 18, 2024
817f63a
update reference for fitbot
scarlehoff Apr 18, 2024
50ecdf4
improve sum rule module
Radonirinaunimi Apr 18, 2024
6fc3388
fix central sum rules
Radonirinaunimi Apr 18, 2024
f06b519
combine limits at more lower levels
Radonirinaunimi Apr 18, 2024
c5f1e30
Merge pull request #2057 from NNPDF/improve-sumrules
Radonirinaunimi Apr 18, 2024
abe5d46
merged changes from master
Radonirinaunimi Apr 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/sphinx/source/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Running fits
./run-fit.md
./run-iterated-fit.rst
./run-qed-fit.rst
./polarized_fits.rst
./general_th_covmat.rst
./thcov_tutorial.rst

Expand Down
122 changes: 122 additions & 0 deletions doc/sphinx/source/tutorials/polarized_fits.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
.. _polarized:

How to run a Polarized fit
==========================

The user should first refer to the :ref:`detailed guide <n3fit-usage>` on how to run
a standard unpolarized PDF fit. Most of the steps in that guide are still apply
and in the following section we only highlight the differences.


Preparing a runcard and running a fit
-------------------------------------

The writing of a polarized fit runcard follows exactly the guideline described
in :ref:`Preparing a fit runcard <prepare-fits>`. The user only need to modify
and adjust various entries.

In polarized fits, the positivity of the polarized PDFs are enforced using as
a boundary condition an unpolarized PDF set. The information on how such a
constraint is enforced is defined under the key ``positivity_bound`` as follows:

.. code-block:: yaml

# Define the unpolarized PDF set to be used as BC for positivity
...
positivity_bound:
unpolarized_bc: NNPDF40_nnlo_pch_as_01180
n_std: 1.00 # Standard Deviation to be added as Shift
...

where ``pdfbc`` specifies the name of the unpolarized PDF set to be used as a
Radonirinaunimi marked this conversation as resolved.
Show resolved Hide resolved
boundary condition while ``stderr`` specifies the shift in terms of the standard
Radonirinaunimi marked this conversation as resolved.
Show resolved Hide resolved
deviation to be applied to the PDF central values. If ``stderr=0.0`` then the
PDF central values will be used to constrain their polarized counterparts.

Given that polarized fits require different fitting bases and different theory
constraints, the fields under the ``fitting`` key require adjustments.
Specifically:

.. code-block:: yaml

...
fitting:
fitbasis: EVOL_POL
sum_rules: TSR
basis:
- {fl: sng, trainable: false, smallx: [1.094, 1.118], largex: [1.46, 3.003]}
- {fl: g, trainable: false, smallx: [0.8189, 1.844], largex: [2.591, 5.697]}
- {fl: t3, trainable: false, smallx: [-0.4401, 0.9163], largex: [1.773, 3.333]}
- {fl: t8, trainable: false, smallx: [0.5852, 0.8537], largex: [1.533, 3.436]}
...

where ``TSR`` specifies that only sum rules on the :math:`T_3` and :math:`T_8`
distributions. If any of these values are specified different the program will
Radonirinaunimi marked this conversation as resolved.
Show resolved Hide resolved
raise an error.

.. note::

While the treatment of integrability follows exactly the same concept as in the
default unpolarized fits, the treatment of positivity in the polarized case
requires specific treatment. Similar to the unpolarised fits, the cost function
used to enforce the positivity is defined by the following observable:

.. math::
\chi_{\mathrm{tot}}^2 \rightarrow \chi_{\mathrm{tot}}^2+ \Lambda_{\rm POS} \sum_{k=1}^8 \sum_{i=1}^{n_i} \operatorname{ReLU}\left(-\mathcal{C}_k\left(x_i, Q^2\right)\right)
Radonirinaunimi marked this conversation as resolved.
Show resolved Hide resolved

where:

.. math::
\mathrm{ReLU}(t)= \begin{cases}t & \text { if } t>0 \\ 0 & \text { if } t \leq 0\end{cases}

with :math:`n_i=20` and :math:`Q^2=5~\mathrm{GeV}^2` chosen to be the same as in the unpolarised
case. In the polarized case, omitting the :math:`Q^2`-dependence, the expression of :math:`\mathcal{C}_k`
is rather given by:

.. math::
\mathcal{C}_k(x_i) = \mathcal{F}_k(x_i) + \Sigma_k(x_i) - | \Delta \mathcal{F}_k(x_i) |

where :math:`\Sigma_k(x_i)` represents the one standard deviation error computed at
:math:`x_i` for the flavour :math:`k`. :math:`\mathcal{F}_k` can be a (p)PDF of
flavour :math:`k` or the longitudinally (polarized) structure functions :math:`(k=1)`.
The way in which the unpolarized prediction uncertainties are accounted for during
the fit is by sampling according to a normal distribution and ought to enforce the
following inequality:

.. math::
\mathcal{N}_r \left( \mathcal{F}_k, \Sigma_k^2 \right) - | \Delta \mathcal{F}_k | \geq 0

where the subscript :math:`r` indicates that the random seed per replica is always
different. In practice, when imposing the positivity at the level of PDFs, we enforce
the constraints on the flavor combination :math:`\left( \Delta f_i + \Delta \bar{f}_i \right)`,
that is :math:`(\Delta) \mathcal{F}_k \equiv (\Delta) f_k + (\Delta) \bar{f}_k`.

Once the runcard is ready, the user can follow the guidelines :ref:`here <run-n3fit-fits>`
to set up and run fits.


Evolving the fit
----------------

In order to evolve the fitted replicas, we have to use the polarized DGLAP evolution. This
can simply be done by supplementing a flag to the ``evolven3fit```:

.. code-block:: bash

evolven3fit evolve $runcard_folder --use_polarized

Alternatively, the user can explicitly specify the path to the EKO using the flag ``--load``.


Comparing polarized fits
------------------------

Additionally, a specific report template should be used when comparing two polarized
fits. This can be done by simply using the ``--use_polarized`` when using ``vp-comparefits``:

.. code-block:: bash

vp-comparefits -i --use_polarized

To read in details how to compare two fits, head to the :ref:`following <compare-fits>`
documentation.
4 changes: 4 additions & 0 deletions doc/sphinx/source/tutorials/run-fit.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ The fitting methodology is detailed in the [Methodology](methodology) page.
- [Upload and analyse the fit](#upload-and-analyse-the-fit)


```eval_rst
.. _prepare-fits:
```

Preparing a fit runcard
-----------------------

Expand Down
1 change: 1 addition & 0 deletions extra_tests/regression_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"trainable_prepro": 61,
"no_lagrange": 27,
"no_csr": 613,
"polarized_evol": 34,
}


Expand Down
80 changes: 80 additions & 0 deletions extra_tests/regression_fits/polarized_evol.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
############################################################
# Configuration file for N3FIT regression Test
############################################################
description: N3FIT regression test for polarised fits

############################################################
dataset_inputs:
- {dataset: E143_NC_4GEV_EP_G1, frac: 0.60, cfac: [NRM]}
- {dataset: E143_NC_8GEV_ED_G1, frac: 0.60, cfac: [NRM]}
- {dataset: E154_NC_9GEV_EN_G1, frac: 0.60, cfac: [NRM]}

############################################################
datacuts:
t0pdfset: NNPDFpol10_100 # PDF set to generate t0 covmat
q2min: 1.00 # Q2 minimum
w2min: 4.00 # W2 minimum

############################################################
# Define the unpolarized PDF set to be used as BC for POS
positivity_bound:
unpolarized_bc: NNPDF40_nnlo_pch_as_01180
n_stdv: 1.00 # Standard Deviation to be added as Error

############################################################
theory:
theoryid: 822

############################################################
trvlseed: 14613416
nnseed: 1865683875
mcseed: 746898422
genrep: true

save: "weights_polevol.h5"
Radonirinaunimi marked this conversation as resolved.
Show resolved Hide resolved

parameters:
nodes_per_layer: [25, 20, 4]
activation_per_layer: [tanh, tanh, linear]
initializer: glorot_normal
optimizer:
clipnorm: 6.073e-6
learning_rate: 2.621e-3
optimizer_name: Nadam
epochs: 20000
positivity:
initial: 1
multiplier:
threshold: 1e-7
integrability:
initial: 1
multiplier:
threshold: 1e-2
stopping_patience: 0.1
layer_type: dense
dropout: 0.0
threshold_chi2: 3.5

fitting:
fitbasis: EVOL_POL
sum_rules: TSR
basis:
- {fl: sng, trainable: false, smallx: [1.094, 1.118], largex: [1.46, 3.003]}
- {fl: g, trainable: false, smallx: [0.8189, 1.844], largex: [2.591, 5.697]}
- {fl: t3, trainable: false, smallx: [-0.4401, 0.9163], largex: [1.773, 3.333]}
- {fl: t8, trainable: false, smallx: [0.5852, 0.8537], largex: [1.533, 3.436]}

###########################################################
positivity:
posdatasets:
- {dataset: NNPDF_POS_5GEV_XDELTAG, maxlambda: 1e8}
- {dataset: NNPDF_POS_5GEV_XDELTADQ, maxlambda: 1e8}

############################################################
integrability:
integdatasets:
- {dataset: NNPDF_INTEG_1GEV_XDELTAG, maxlambda: 1e2}
- {dataset: NNPDF_INTEG_1GEV_XDELTASIGMA, maxlambda: 1e2}

############################################################
debug: true
109 changes: 109 additions & 0 deletions n3fit/runcards/examples/nnpdfpol20_dis_nnlo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
############################################################
# Configuration file for N3FIT
############################################################
description: NNPDFpol2.0 NNLO DIS fit with ID822 (W2min=4)

############################################################
dataset_inputs:
# -------------- Superseeded by COMPASS15 ---------------------
# - {dataset: COMPASS_NC_17GEV_MUP_G1, frac: 0.60, cfac: [NRM]}
# - {dataset: COMPASS_NC_25GEV_MUD_G1, frac: 0.60, cfac: [NRM]}
# -------------------------------------------------------------
- {dataset: COMPASS15_NC_17GEV_MUP_G1, frac: 0.60, cfac: [NRM]}
- {dataset: COMPASS15_NC_25GEV_MUD_G1, frac: 0.60, cfac: [NRM]}
- {dataset: E142_NC_58GEV_EN_G1, frac: 0.60, cfac: [NRM]}
- {dataset: E143_NC_4GEV_EP_G1, frac: 0.60, cfac: [NRM]}
- {dataset: E143_NC_8GEV_ED_G1, frac: 0.60, cfac: [NRM]}
- {dataset: E154_NC_9GEV_EN_G1, frac: 0.60, cfac: [NRM]}
- {dataset: E155_NC_9GEV_EN_G1F1RATIO, frac: 0.60}
- {dataset: E155_NC_9GEV_EP_G1F1RATIO, frac: 0.60}
- {dataset: EMC_NC_16GEV_MUP_G1, frac: 0.60, cfac: [NRM]}
- {dataset: HERMES_NC_7GEV_ED_G1, frac: 0.60, cfac: [NRM]}
- {dataset: HERMES_NC_7GEV_EP_G1, frac: 0.60, cfac: [NRM]}
# ------------- Same as P+D due to Isospin --------------------
# - {dataset: HERMES_NC_7GEV_EN_G1, frac: 0.60, cfac: [NRM]}
# -------------------------------------------------------------
- {dataset: HERMES97_NC_7GEV_EN_G1, frac: 0.60, cfac: [NRM]}
- {dataset: JLABE06_NC_3GEV_EN_G1F1RATIO, frac: 0.60}
- {dataset: JLABEG1B_NC_3GEV_EP_G1F1RATIO, frac: 0.60}
- {dataset: JLABEG1B_NC_4GEV_ED_G1F1RATIO, frac: 0.60}
- {dataset: JLABE97_NC_3GEV_EN_G1, frac: 0.60, cfac: [NRM]}
- {dataset: JLABE99_NC_3GEV_EN_G1F1RATIO, frac: 0.60}
- {dataset: JLABEG1DVCS_NC_5GEV_ED_G1F1RATIO, frac: 0.60}
- {dataset: JLABEG1DVCS_NC_3GEV_EP_G1F1RATIO, frac: 0.60}
- {dataset: SMC_NC_24GEV_MUD_G1, frac: 0.60, cfac: [NRM]}
- {dataset: SMC_NC_17GEV_MUP_G1, frac: 0.60, cfac: [NRM]}
- {dataset: SMCSX_NC_24GEV_MUD_G1F1RATIO, frac: 0.60}
- {dataset: SMCSX_NC_17GEV_MUP_G1F1RATIO, frac: 0.60}

############################################################
datacuts:
t0pdfset: NNPDFpol10_100 # PDF set to generate t0 covmat
q2min: 1.00 # Q2 minimum
w2min: 4.00 # W2 minimum

############################################################
# Define the unpolarized PDF set to be used as BC for POS
positivity_bound:
unpolarized_bc: NNPDF40_nnlo_pch_as_01180
n_stdv: 1.00 # Standard Deviation to be added as Error

############################################################
theory:
theoryid: 822

############################################################
trvlseed: 14613416
nnseed: 1865683875
mcseed: 746898422
save: false
genrep: true

parameters:
nodes_per_layer: [25, 20, 4]
activation_per_layer: [tanh, tanh, linear]
initializer: glorot_normal
optimizer:
clipnorm: 6.073e-6
learning_rate: 2.621e-3
optimizer_name: Nadam
epochs: 20000
positivity:
initial: 1
multiplier:
threshold: 1e-7
integrability:
initial: 1
multiplier:
threshold: 1e-2
stopping_patience: 0.1
layer_type: dense
dropout: 0.0
threshold_chi2: 3.5

fitting:
fitbasis: EVOL_POL
sum_rules: TSR
basis:
- {fl: sng, trainable: false, smallx: [1.094, 1.118], largex: [1.46, 3.003]}
- {fl: g, trainable: false, smallx: [0.8189, 1.844], largex: [2.591, 5.697]}
- {fl: t3, trainable: false, smallx: [-0.4401, 0.9163], largex: [1.773, 3.333]}
- {fl: t8, trainable: false, smallx: [0.5852, 0.8537], largex: [1.533, 3.436]}

###########################################################
positivity:
posdatasets:
- {dataset: NNPDF_POS_5GEV_XDELTAG, maxlambda: 1e8}
- {dataset: NNPDF_POS_5GEV_XDELTADQ, maxlambda: 1e8}
- {dataset: NNPDF_POS_5GEV_XDELTASQ, maxlambda: 1e8}
- {dataset: NNPDF_POS_5GEV_XDELTAUQ, maxlambda: 1e8}

############################################################
integrability:
integdatasets:
- {dataset: NNPDF_INTEG_1GEV_XDELTAG, maxlambda: 1e2}
- {dataset: NNPDF_INTEG_1GEV_XDELTASIGMA, maxlambda: 1e2}

############################################################
debug: false
maxcores: 4
15 changes: 15 additions & 0 deletions n3fit/src/n3fit/backends/keras_backend/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,21 @@ def pow(tensor, power):
return tf.pow(tensor, power)


@tf.function
def absolute(tensor):
"""
Compute the absolute value of a tensor
"""
return K.abs(tensor)


def multiply_minusone(tensor):
Radonirinaunimi marked this conversation as resolved.
Show resolved Hide resolved
"""
Multiply the elements of a given tensor by (-1)
"""
return keras_Lambda(lambda x: -1 * x)(tensor)


@tf.function(reduce_retracing=True)
def op_log(o_tensor, **kwargs):
"""
Expand Down
Loading
Loading