Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Chihiro-n/csiro-biomass-agentic-solution
/ functions
Functions
297 in github.com/Chihiro-n/csiro-biomass-agentic-solution
⨍
Functions
297
◇
Types & classes
64
↓ 15 callers
Method
__init__
(self, r2_weights, bin_edges_config, label_smoothing=0.1)
EXP/EXP060/train.py:3493
↓ 12 callers
Function
compute_r2_score
Compute globally weighted R² score (official Kaggle competition metric). All (image, target) pairs are combined into one long list, and each
EXP/EXP060/train.py:3986
↓ 6 callers
Method
__init__
(self, model_name="eva02_large_patch14_448.mim_m38m_ft_in22k_in1k", pretrained=True, dropout=
EXP/EXP060/infer.py:863
↓ 5 callers
Method
__init__
(self, r2_weights, consistency_weight=0.1, pred_loss_cfg=None, mask_presence_cfg=None)
EXP/EXP113/train.py:1361
↓ 5 callers
Method
_create_gaussian_head
Create a Gaussian head as ModuleList: [hidden, mu, log_var].
EXP/EXP060/train.py:2722
↓ 5 callers
Method
_create_gaussian_head
Create a Gaussian head as ModuleList: [hidden, mu, log_var].
EXP/EXP060/infer.py:1132
↓ 5 callers
Method
_forward_gaussian_head
Forward pass through a Gaussian head ModuleList.
EXP/EXP060/train.py:2745
↓ 5 callers
Method
_forward_gaussian_head
Forward pass through a Gaussian head, returning only mu.
EXP/EXP060/infer.py:1147
↓ 5 callers
Method
_pairwise_ranking_loss
Compute pairwise ranking loss for a single target. For all pairs (i, j) where true[i] > true[j]: loss += max(0, margin -
EXP/EXP060/train.py:3827
↓ 5 callers
Method
_pred_loss
(self, pred, target, target_name)
EXP/EXP060/train.py:3597
↓ 5 callers
Function
bin_logits_to_expected_value
Convert bin logits to expected value (regression output). Args: logits: [B, num_bins] raw logits bin_centers_tensor: [num_bi
EXP/EXP060/train.py:3298
↓ 5 callers
Method
train
Override train to keep backbone in eval mode (frozen).
EXP/EXP113/train.py:1087
↓ 5 callers
Function
value_to_bin_index
Convert continuous values to bin indices. Args: values: np.array of values edges: np.array of bin edges [e0, e1, e2, ...]
EXP/EXP060/train.py:3277
↓ 4 callers
Method
__init__
(self, df, transform, image_dir)
EXP/EXP113/infer.py:55
↓ 3 callers
Method
_tokens_to_2d
Convert patch tokens [B, N, C] to 2D spatial grid [B, C, H, W].
EXP/EXP113/train.py:1136
↓ 3 callers
Method
_tokens_to_2d
Convert patch tokens [B, N, C] to 2D spatial grid [B, C, H, W].
EXP/EXP113/infer.py:523
↓ 3 callers
Method
_tokens_to_2d
(self, tokens, B)
EXP/EXP113/infer_fast.py:195
↓ 3 callers
Method
backward
(ctx, grad_output)
EXP/EXP060/train.py:120
↓ 3 callers
Function
compute_r2_score
Compute globally weighted R2 score (official Kaggle competition metric). Formula: SS_res = sum(w_i * (y_i - y_pred_i)^2) SS_
EXP/EXP113/train.py:1649
↓ 3 callers
Method
get_backbone_blocks
Get vision transformer blocks for gradual unfreezing.
EXP/EXP060/train.py:2299
↓ 3 callers
Method
get_backbone_blocks
(self)
EXP/EXP113/train.py:1094
↓ 3 callers
Function
load_model_for_ttt
Load a model for TTT (with trainable heads).
EXP/EXP060/infer_ttt.py:428
↓ 3 callers
Function
pick
(q: float)
EXP/EXP113/train.py:1492
↓ 3 callers
Function
run_inference
Main inference function with fold ensemble. Args: config: Configuration dict model_dir: Directory containing model checkpoin
EXP/EXP060/infer.py:1681
↓ 3 callers
Method
unfreeze_last_n_blocks
Unfreeze the last n transformer blocks of the vision encoder.
EXP/EXP060/train.py:2305
↓ 2 callers
Method
__init__
(self, df, transform, image_dir, target_cols)
EXP/EXP060/infer_ttt.py:153
↓ 2 callers
Method
__init__
(self, df, transform, image_dir)
EXP/EXP113/infer_fast.py:49
↓ 2 callers
Method
_apply_bc
(self, img: Image.Image, brightness_factor: float, contrast_factor: float)
EXP/EXP060/infer.py:314
↓ 2 callers
Method
_apply_blur
Apply Gaussian blur with specified radius.
EXP/EXP060/infer.py:378
↓ 2 callers
Method
_apply_blur
Apply Gaussian blur with specified radius.
EXP/EXP060/infer.py:447
↓ 2 callers
Method
_load_half_image
Load left or right half of an image.
EXP/EXP060/train.py:1696
↓ 2 callers
Method
_make_views
(self, img_half: Image.Image)
EXP/EXP060/infer.py:241
↓ 2 callers
Method
_make_views
(self, img_half: Image.Image)
EXP/EXP060/infer.py:319
↓ 2 callers
Method
_make_views
(self, img_half: Image.Image)
EXP/EXP060/infer.py:453
↓ 2 callers
Function
_to_odd_kernel
(k: int)
EXP/EXP113/train.py:1473
↓ 2 callers
Function
apply_enforce_sums
(preds_dict)
EXP/EXP060/train.py:6197
↓ 2 callers
Function
apply_post_process_arrays
Optional physics-consistent post-processing. mode: - "none": no changes - "total_correction": Total = Green + Dead + Clover
EXP/EXP060/infer.py:2061
↓ 2 callers
Function
apply_post_process_arrays
Optional physics-consistent post-processing. mode: - "none": no changes - "total_correction": Total = Green + Dead + Clover
EXP/EXP113/infer.py:1016
↓ 2 callers
Function
apply_project_to_totals
(preds_dict)
EXP/EXP060/train.py:6211
↓ 2 callers
Function
apply_quality_augmentation_if_enabled
Optionally append label-preserving "quality diversity" augmentation based on config.
EXP/EXP060/train.py:943
↓ 2 callers
Function
apply_total_correction
(preds_dict)
EXP/EXP060/train.py:6189
↓ 2 callers
Function
calc_weighted_r2
(y_true, y_pred, weights)
EXP/EXP060/infer.py:2385
↓ 2 callers
Function
calculate_derived_targets
Calculate Dry_Dead_g and Dry_Clover_g from predicted values.
EXP/EXP060/train.py:4035
↓ 2 callers
Function
create_debug_predictions
Create a debug CSV with predictions for sampled train images.
EXP/EXP060/infer.py:2000
↓ 2 callers
Function
create_submission
Create submission file from predictions.
EXP/EXP060/infer.py:2175
↓ 2 callers
Function
create_submission
Create submission file from predictions.
EXP/EXP113/infer.py:1105
↓ 2 callers
Function
get_train_augmentation
Default augmentation (same as child-exp000).
EXP/EXP060/infer_ttt.py:324
↓ 2 callers
Function
load_config
Load YAML configuration file.
EXP/EXP060/infer.py:82
↓ 2 callers
Function
load_config
Load YAML configuration file.
EXP/EXP113/infer.py:34
↓ 2 callers
Function
predict_fold
Run prediction with one fold model.
EXP/EXP060/infer_ttt.py:391
↓ 2 callers
Function
resolve_first_existing_path
(*candidates: str)
EXP/EXP060/infer.py:2168
↓ 2 callers
Function
resolve_first_existing_path
Return the first existing path from candidates.
EXP/EXP113/infer.py:1183
↓ 2 callers
Function
run_inference
Main inference function with fold ensemble. Args: config: Configuration dict model_dir: Directory containing model checkpoin
EXP/EXP113/infer.py:799
↓ 2 callers
Method
set_patch_dropout
Set patch dropout probability. Useful for enabling/disabling during training (epoch control) or MC inference. Args:
EXP/EXP113/train.py:1144
↓ 2 callers
Method
set_patch_dropout
Set patch dropout probability for MC inference.
EXP/EXP113/infer_fast.py:202
↓ 2 callers
Function
train_one_epoch_ttt
Train for one epoch (TTT mode - heads only).
EXP/EXP060/infer_ttt.py:356
↓ 2 callers
Method
unfreeze_last_n_blocks
(self, n)
EXP/EXP113/train.py:1099
↓ 1 callers
Function
_approx_iqr_z
Robust z-score using per-sample median/IQR. residual: [B, 1, H, W] -> z: [B, 1, H, W]
EXP/EXP113/train.py:1480
↓ 1 callers
Method
_five_crop_boxes
(width: int, height: int, crop_size: int)
EXP/EXP060/infer.py:227
↓ 1 callers
Method
_init_log_var_bias
Initialize log_var bias to 0 (variance = 1).
EXP/EXP060/train.py:2737
↓ 1 callers
Method
_load_depth
Load depth map and process to patch grid size.
EXP/EXP113/train.py:289
↓ 1 callers
Method
_load_depth
Load depth map and split into left/right halves.
EXP/EXP113/train.py:421
↓ 1 callers
Function
_load_one_model
Load a single fold model for inference. Returns model or None if not found. Args: fold: Fold number config: Configuratio
EXP/EXP060/infer.py:1514
↓ 1 callers
Function
_load_one_model
Load a single fold model for inference. Args: fold: Fold number config: Configuration dict model_dir: Directory cont
EXP/EXP113/infer.py:692
↓ 1 callers
Method
_normalize_height
Normalize height using log1p (handles right-skewed distribution).
EXP/EXP060/train.py:2597
↓ 1 callers
Function
_normalize_spatial
(x: torch.Tensor, eps: float = 1e-6)
EXP/EXP113/train.py:1506
↓ 1 callers
Function
apply_left_right_cutmix
Apply CutMix between left and right patches of the same image. Since both patches have the same label (y/2), the mixed label remains y/2.
EXP/EXP060/train.py:1037
↓ 1 callers
Method
backward
(ctx, grad_output)
EXP/EXP113/train.py:94
↓ 1 callers
Function
build_pre_split_augmentation
Build augmentation to apply on the FULL 2000x1000 image BEFORE splitting. This is used to keep left/right halves consistent (same photometric/geo
EXP/EXP060/train.py:843
↓ 1 callers
Function
compute_depth_attention_ce_loss
Depth attention regularization (train-only; inference unchanged). Builds attention from detrended depth residual: attn = relu(z)^heigh
EXP/EXP113/train.py:1511
↓ 1 callers
Function
compute_image_sample_weights
Compute per-image sample weights (length = len(df_wide)). Intended for train-only reweighting / oversampling; weights are applied to both ha
EXP/EXP060/train.py:1836
↓ 1 callers
Method
compute_view_consistency_loss
Compute view consistency loss between original and flipped predictions. Enforces: pred(original) ≈ pred(flipped) Args:
EXP/EXP060/train.py:3661
↓ 1 callers
Function
create_bin_edges_and_centers
Create bin edges and centers from config. Args: bin_edges_config: dict of {target_name: [edge0, edge1, ...]} Returns: b
EXP/EXP060/train.py:3237
↓ 1 callers
Function
create_debug_output
Create debug output with predictions vs ground truth.
EXP/EXP113/infer_fast.py:691
↓ 1 callers
Function
create_debug_predictions
Create a debug CSV with predictions for sampled train images.
EXP/EXP113/infer.py:971
↓ 1 callers
Function
create_fold_split
Create train/val split for a specific fold. Uses StratifiedGroupKFold by State and Sampling_Date (same as EXP060-000).
EXP/EXP060/infer_ttt.py:467
↓ 1 callers
Function
create_oof_predictions
Generate Out-of-Fold predictions after training. Uses OOF approach: sum predictions from left and right halves. When enable_tta=True, ou
EXP/EXP060/train.py:5682
↓ 1 callers
Function
create_oof_predictions
Generate Out-of-Fold predictions after training.
EXP/EXP113/train.py:2465
↓ 1 callers
Function
create_submission
Create submission file.
EXP/EXP113/infer_fast.py:646
↓ 1 callers
Method
depth_to_weight
Convert depth map to integration weight. Uses rank normalization (robust to outliers) and mean=1 normalization to keep densi
EXP/EXP113/train.py:1107
↓ 1 callers
Method
get_backbone_blocks
Get vision transformer blocks for gradual unfreezing.
EXP/EXP060/train.py:1960
↓ 1 callers
Method
get_backbone_blocks
Get vision transformer blocks for gradual unfreezing.
EXP/EXP060/train.py:2175
↓ 1 callers
Method
get_backbone_blocks
(self)
EXP/EXP060/train.py:2414
↓ 1 callers
Method
get_backbone_blocks
(self)
EXP/EXP060/train.py:2584
↓ 1 callers
Method
get_backbone_blocks
(self)
EXP/EXP060/train.py:2759
↓ 1 callers
Method
get_backbone_blocks
(self)
EXP/EXP060/train.py:2890
↓ 1 callers
Method
get_backbone_blocks
Get vision transformer blocks for gradual unfreezing.
EXP/EXP060/train.py:2999
↓ 1 callers
Method
get_backbone_blocks
Get vision transformer blocks for gradual unfreezing.
EXP/EXP060/train.py:3170
↓ 1 callers
Method
get_backbone_blocks
Get vision transformer blocks for gradual unfreezing.
EXP/EXP060/train.py:3427
↓ 1 callers
Method
get_backbone_blocks
(self)
EXP/EXP113/train.py:638
↓ 1 callers
Function
get_grl_lambda
Calculate GRL lambda with warmup schedule. Uses sigmoid schedule: λ(p) = λ_max × (2 / (1 + exp(-10p)) - 1) where p = epoch / total_epoch
EXP/EXP060/train.py:144
↓ 1 callers
Function
get_grl_lambda
Calculate GRL lambda with warmup schedule. Uses sigmoid schedule: λ(p) = λ_max × (2 / (1 + exp(-10p)) - 1) where p = epoch / total_epoch
EXP/EXP113/train.py:118
↓ 1 callers
Function
get_train_augmentation
Enhanced augmentation pipeline for training. All augmentations preserve the amount of grass in the image. Args: aug_version: 'de
EXP/EXP060/train.py:267
↓ 1 callers
Function
get_train_augmentation
Augmentation pipeline for training. All augmentations preserve the amount of grass in the image. Args: config: Optional config d
EXP/EXP113/train.py:146
↓ 1 callers
Function
get_train_augmentation_3crop
Augmentation pipeline for 3-crop dataset. IMPORTANT: This is applied to the FULL 2000x1000 image BEFORE splitting. Therefore, we must EX
EXP/EXP060/train.py:801
↓ 1 callers
Function
get_unfreezing_schedule
Create a schedule for gradual block unfreezing for Vision Transformer. Args: total_epochs: Total number of training epochs f
EXP/EXP060/train.py:4046
↓ 1 callers
Function
get_unfreezing_schedule
Create a schedule for gradual block unfreezing. Returns: List of tuples (epoch, num_blocks_to_unfreeze, backbone_lr)
EXP/EXP113/train.py:1690
↓ 1 callers
Function
is_evaclip_model
Check if model is an EVA-CLIP model.
EXP/EXP060/train.py:165
↓ 1 callers
Function
load_config
Load YAML configuration file.
EXP/EXP060/train.py:260
↓ 1 callers
Function
load_config
Load YAML configuration file.
EXP/EXP060/infer_ttt.py:67
next →
1–100 of 297, ranked by callers