Join the newly launched Discord
community for real-time discussions, peer support, and direct interaction with the Meridian team!
meridian.model.adstock_hill.HillTransformer
Stay organized with collections
Save and categorize content based on your preferences.
Class to compute the Hill transformation of media.
Inherits From: AdstockHillTransformer
meridian
.
model
.
adstock_hill
.
HillTransformer
(
ec
:
meridian
.
backend
.
Tensor
,
slope
:
meridian
.
backend
.
Tensor
)
Tensor with dimensions [..., n_media_channels]
. Batch dimensions (...)
are optional, but if batch dimensions are included, they must
match the batch dimensions of ec
.
Tensor with dimensions [..., n_media_channels]
. Batch dimensions (...)
are optional, but if batch dimensions are included, they must
match the batch dimensions of slope
.
Methods
forward
View source
forward
(
media
:
meridian
.
backend
.
Tensor
)
->
meridian
.
backend
.
Tensor
Computes the Hill transformation of a given media
tensor.
Calculates results for the Hill function, which accounts for the diminishing
returns of media effects.
media
Tensor with dimensions [..., n_geos, n_media_times,
n_media_channels]
. Batch dimensions (...)
are optional, but if batch
dimensions are included, they must match the batch dimensions of slope
and ec
. Media is not required to have batch dimensions even if slope
and ec
contain batch dimensions.
Tensor with dimensions [..., n_geos, n_media_times, n_media_channels]
representing Hill-transformed media.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-05 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-05 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eHillTransformer\u003c/code\u003e class computes the Hill transformation of media, accounting for diminishing returns in media effects.\u003c/p\u003e\n"],["\u003cp\u003eIt takes two main arguments, \u003ccode\u003eec\u003c/code\u003e and \u003ccode\u003eslope\u003c/code\u003e, which are tensors that must have compatible dimensions and represent media channel parameters.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eforward\u003c/code\u003e method of \u003ccode\u003eHillTransformer\u003c/code\u003e accepts a \u003ccode\u003emedia\u003c/code\u003e tensor as input, which can have optional batch dimensions but requires dimensions for geos, media times, and media channels.\u003c/p\u003e\n"],["\u003cp\u003eThe output of the \u003ccode\u003eforward\u003c/code\u003e method is a tensor of the same dimensions as the input \u003ccode\u003emedia\u003c/code\u003e tensor, but with the Hill transformation applied, representing the transformed media.\u003c/p\u003e\n"]]],["The `HillTransformer` class computes the Hill transformation of media data, accounting for diminishing returns. It takes two main tensors as input: `ec` and `slope`, both with optional batch dimensions matching each other. The `forward` method applies the Hill function to a `media` tensor, which may include batch, geo, time, and media channel dimensions. This method returns a tensor with the same geo, time, and media channel dimensions as the input, representing the Hill-transformed media.\n"],null,["\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/google/meridian/blob/v1.2.0/meridian/model/adstock_hill.py#L404-L438) |\n\nClass to compute the Hill transformation of media.\n\nInherits From: [`AdstockHillTransformer`](../../../meridian/model/adstock_hill/AdstockHillTransformer.md) \n\n meridian.model.adstock_hill.HillTransformer(\n ec: ../../../meridian/backend/Tensor.md,\n slope: ../../../meridian/backend/Tensor.md\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `ec` | Tensor with dimensions `[..., n_media_channels]`. Batch dimensions `(...)` are optional, but if batch dimensions are included, they must match the batch dimensions of `ec`. |\n| `slope` | Tensor with dimensions `[..., n_media_channels]`. Batch dimensions `(...)` are optional, but if batch dimensions are included, they must match the batch dimensions of `slope`. |\n\n\u003cbr /\u003e\n\nMethods\n\n`forward`\n\n[View source](https://github.com/google/meridian/blob/v1.2.0/meridian/model/adstock_hill.py#L421-L438) \n\n forward(\n media: ../../../meridian/backend/Tensor.md\n ) -\u003e ../../../meridian/backend/Tensor.md\n\nComputes the Hill transformation of a given `media` tensor.\n\nCalculates results for the Hill function, which accounts for the diminishing\nreturns of media effects.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `media` | Tensor with dimensions `[..., n_geos, n_media_times, n_media_channels]`. Batch dimensions `(...)` are optional, but if batch dimensions are included, they must match the batch dimensions of `slope` and `ec`. Media is not required to have batch dimensions even if `slope` and `ec` contain batch dimensions. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| Tensor with dimensions `[..., n_geos, n_media_times, n_media_channels]` representing Hill-transformed media. ||\n\n\u003cbr /\u003e"]]