Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loaded from https://github.com/philc/vimium/blob/master/README.md | |
? show the help dialog for a list of all available keys | |
h scroll left | |
j scroll down | |
k scroll up | |
l scroll right | |
gg scroll to top of the page | |
G scroll to bottom of the page | |
d scroll down half a page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the package you need is pipreqs | |
pip install pipreqs | |
# they have a number of arguments. the most useful i found | |
# is the argument allowing you to check your package on pypi server. | |
# this fixed bugs in the requriements.txt packages. e.g skimage is not a package, but pipreqs was listing it down | |
# another is the version number listed by the pipreqs might be messed up. | |
python -m pipreqs.pipreqs . --force --mode gt --pypi-server https://pypi.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This is simple implementation of a binary cross entropy. | |
Test cases : done. | |
""" | |
import torch | |
def balanced_BCE_loss(predictions: torch.Tensor, ground_truth: torch.Tensor, with_logits=False) -> torch.Tensor: | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
import torch | |
import torch.nn.functional as F # for using softmax | |
cc = torch.manual_seed(0) # for reproducibility | |
# somehow on my m1 mac, the randomness is not reproducible. todo: figure out why | |
b = 1 # mini batch size | |
t = 3 # sequence length | |
k = 2 # dimension of each vector in the sequence |