Posts

model training and scenarios

Image
Common challenges in a model training are  1. overfitting - high train accuracy, terrible production performance  Red flag signals Train accuracy 98%+, val accuracy 65–70% Train loss keeps falling, val loss starts rising (divergence point) Large gap between train F1 and val F1 Model memorises noise — shuffling labels barely changes train loss Primary metrics to watch Train/val loss gap Generalisation gap Val accuracy Learning curves Val F1 Watch the gap , not the absolute numbers. Train acc 98% is fine if val acc is also 94%. The gap is the signal. Primary metrics to watch Train/val loss gap Generalisation gap Val accuracy Learning curves Val F1 Watch the gap , not the absolute numbers. Train acc 98% is fine if val acc is also 94%. The gap is the signal. This is what a overfitting learning curve graph looks like. As you can see the generalization gap higher than 0.15 is a red flag. In our case, it is 0.426.  One more thing to note is the red line will diverge and ...

terraform understanding for_each vs for

Maybe one of the most often used construct in terraform are the for_each and for loop. Just to clarify these 2 constructs. In Terraform, for and for_each sound almost identical, but they serve entirely different purposes. Here is the golden rule to tell them apart: for_each is a meta-argument used to duplicate resources or modules (it creates multiple infrastructure objects). for is a looping expression used to transform values within a resource attribute (it outputs a new list or map).   Feature for_each (Meta-argument) for (Expression) What it does Multiplies resources/modules. Transforms data structures. Where it lives Directly inside a resource or module block. Inside an attribute assignment (e.g., tags = ... ). Accepted Inputs set of strings, or a map . (Lists not allowed directly). list , set , tuple , map . Output Multiple cloud resources. A single list or map value. 1. The for_each Meta-argument Use for_each when you want to spin up multiple copies of the sa...