"from typing import List
def traprainwater(height: List[int]) -> int:
if not height:
return 0
l, r = 0, len(height) - 1
leftMax, rightMax = height[l], height[r]
res = 0
while l < r:
if leftMax < rightMax:
l += 1
leftMax = max(leftMax, height[l])
res += leftMax - height[l]
else:
r -= 1
rightMax = max(rightMax, height[r])
"
Anonymous Roadrunner - "from typing import List
def traprainwater(height: List[int]) -> int:
if not height:
return 0
l, r = 0, len(height) - 1
leftMax, rightMax = height[l], height[r]
res = 0
while l < r:
if leftMax < rightMax:
l += 1
leftMax = max(leftMax, height[l])
res += leftMax - height[l]
else:
r -= 1
rightMax = max(rightMax, height[r])
"See full answer
"Effective loss functions for computer vision models vary depending on the specific task, some commonly used loss functions for different tasks:
Classification
Cross-Entropy Loss:Used for multi-class classification tasks.
Measures the difference between the predicted probability distribution and the true distribution.
Binary Cross-Entropy Loss:Used for binary classification tasks.
Evaluates the performance of a model by comparing predicted probabilities to the true binary labe"
Shibin P. - "Effective loss functions for computer vision models vary depending on the specific task, some commonly used loss functions for different tasks:
Classification
Cross-Entropy Loss:Used for multi-class classification tasks.
Measures the difference between the predicted probability distribution and the true distribution.
Binary Cross-Entropy Loss:Used for binary classification tasks.
Evaluates the performance of a model by comparing predicted probabilities to the true binary labe"See full answer
"Given the dataset does not contain many labels, it implies we cannot directly use supervised learning.
I would ask more about the type of dataset we are given. Is it images, text, etc? This may inform the types of transformations we do the dataset.
I can see two approaches to training
Given the labels we do have, we can find a method to generate labels for the other unlabeled data. This likely will introduce some error since they may not be true labels, but it at least allows processing the"
Matt M. - "Given the dataset does not contain many labels, it implies we cannot directly use supervised learning.
I would ask more about the type of dataset we are given. Is it images, text, etc? This may inform the types of transformations we do the dataset.
I can see two approaches to training
Given the labels we do have, we can find a method to generate labels for the other unlabeled data. This likely will introduce some error since they may not be true labels, but it at least allows processing the"See full answer
Machine Learning Engineer
Concept
🧠Want an expert answer to a question? Saving questions lets us know what content to make next.
"That I had not been a PM for a formal ML product. But good models need sound data and my five years of sql writing and ensuring that DWHs and marts had the data they needed for reporting would be very relevant"
Tony C. - "That I had not been a PM for a formal ML product. But good models need sound data and my five years of sql writing and ensuring that DWHs and marts had the data they needed for reporting would be very relevant"See full answer