Join the newly launched
Discord community for real-time discussions, peer support, and direct interaction with the Meridian team!
meridian.model.transformers.CenteringAndScalingTransformer
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מחילה על טרנספורמציות של מירכוך והתאמה לעומס (scaling) של טנזור.
עובר בירושה מ-: TensorTransformer
meridian.model.transformers.CenteringAndScalingTransformer(
tensor: tf.Tensor,
population: tf.Tensor,
population_scaling_id: (tf.Tensor | None) = None
)
המחלקה הזו מבצעת טרנספורמציה של טנזור כך שלכל משתנה יש ממוצע אפס וסטיית תקן אחת. אפשר גם לשנות את קנה המידה של כל משתנה לפי אוכלוסייה לפני החלת הטרנספורמציות של מרכוז ושינוי קנה מידה. בכיתה מאוחסנים הממוצע וסטיית התקן של כל משתנה.
Args |
tensor
|
טנזור של המאפיין (n_geos, n_times, n_channel) המשמש לחישוב האמצעים וסטיות התקן.
|
population
|
ערך img_tensor של המאפיין (n_geos,) , שמכיל את האוכלוסייה של כל אחד מהמאפיינים הגיאוגרפיים האלו, משמש לחישוב הגורמים של ההתאמה.
|
population_scaling_id
|
עוצמה בוליאנית אופציונלית של מאפיין (n_channels,) , שמציינת את המשתנים שבהם הערך ישתנה לפי אוכלוסייה.
|
שיטות
forward
הצגת המקור
forward(
tensor: tf.Tensor
) -> tf.Tensor
שינוי הגודל של טינסור נתון באמצעות המקדמים השמורים.
inverse
הצגת המקור
inverse(
tensor: tf.Tensor
) -> tf.Tensor
מבצעת התאמה של טנזור נתון באמצעות המקדמים המאוחסנים.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-11-14 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2024-11-14 (שעון UTC)."],[],["This content describes a `CenteringAndScalingTransformer` class that transforms a tensor by centering (mean zero) and scaling (standard deviation one) its variables. It takes a tensor, population data, and an optional population scaling ID as input. The class stores the mean and standard deviation. It has two main methods: `forward`, which applies the scaling to a tensor, and `inverse`, which reverses the scaling using the stored coefficients. The transformations can be applied channel-wise with the `population_scaling_id`.\n"],null,[]]