Skip to content

Instantly share code, notes, and snippets.

View iKrishneel's full-sized avatar
🏠
Working from home

Krishneel iKrishneel

🏠
Working from home
View GitHub Profile
@mael
mael / tricks.md
Last active July 16, 2024 11:44
Xcode 10.2 "Unable to boot the Simulator"

Solution "Unable to boot the Simulator"

sudo mkdir /private/tmp

sudo chmod 1777 /private/tmp

Other basic command

xcrun

xcrun simctl list devices //to list all simulators

xcrun simctl delete // to delete specific device

def trimmed_mae_loss(prediction, target, mask, trim=0.2):
M = torch.sum(mask, (1, 2))
res = prediction - target
res = res[mask.bool()].abs()
trimmed, _ = torch.sort(res.view(-1), descending=False)[
: int(len(res) * (1.0 - trim))
]