המחלקה הזו מבצעת טרנספורמציה של טנזור כך שלכל משתנה יש ממוצע אפס וסטיית תקן אחת. אפשר גם לשנות את קנה המידה של כל משתנה לפי אוכלוסייה לפני החלת הטרנספורמציות של מרכוז ושינוי קנה מידה. בכיתה מאוחסנים הממוצע וסטיית התקן של כל משתנה.
Args
tensor
טנזור של המאפיין (n_geos, n_times, n_channel) המשמש לחישוב האמצעים וסטיות התקן.
population
ערך img_tensor של המאפיין (n_geos,), שמכיל את האוכלוסייה של כל אחד מהמאפיינים הגיאוגרפיים האלו, משמש לחישוב הגורמים של ההתאמה.
population_scaling_id
עוצמה בוליאנית אופציונלית של מאפיין (n_channels,), שמציינת את המשתנים שבהם הערך ישתנה לפי אוכלוסייה.
[[["התוכן קל להבנה","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"]]