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
1 df | |
2 ls /dev/sdh | |
3 cd /dev/sdh | |
4 sudo mount /dev/sdb1 ~/runs | |
5 mkdir runs | |
6 sudo mount /dev/sdb1 ~/runs | |
7 sudo mount /dev/sh~/runs | |
8 sudo mount /dev/sdh ~/runs | |
9 ls | |
10 cd runs |
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
ffmpeg -i input.mp4 -filter:v "crop=674:64:0:0" output.mp4 |
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
diff --git a/mac/mac_vanilla.py b/mac/mac_vanilla.py | |
index 1565db7..28d5970 100644 | |
--- a/mac/mac_vanilla.py | |
+++ b/mac/mac_vanilla.py | |
@@ -1,3 +1,5 @@ | |
+from copy import deepcopy | |
+ | |
import torch | |
from torch import nn | |
from torch import optim |
The new 1.10 version of hdf5 library is stable. You can now install from the source to use this new capability.
The installation process has a few caveats, so here is how to do it.
- you need to first remove the hdf5 libraries currently installed in ubuntu.
- Then you need to reinstall
h5py
. - when you reinstall h5py via pip, use the
--no-binary
flag. This is because the h5py wheel comes with its own hdf5 binary.
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
class MultiHeadedMlp(nn.Module): | |
def __init__(self, input_dim, *out_dims): | |
super().__init__() | |
self.out_dims = out_dims | |
self.heads = nn.ModuleList([nn.Linear(input_dim, dim) for dim in out_dims]) | |
def forward(self, i): | |
return [h(i) for h in self.heads] | |
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
#!/bin/bash | |
echo "Restarting bluetooth service..." | |
blueutil -p 0 && sleep 1 && blueutil -p 1 | |
echo "Waiting bluetooth service to be restored..." | |
until blueutil -p | grep "1" >/dev/null; do sleep 1; done | |
echo "Searching for devices not connected..." | |
devices=($(blueutil --paired | grep "not connected" | awk -F '[ ,]' '{print $2}')) |
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
version: 0 | |
hosts: | |
fair: &devfair_host | |
ip: localhost | |
port: 41000 | |
username: geyang | |
pem: ~/.ssh/fair-loaner | |
mounts: | |
- !mounts.SSHCode &plan2vec_code | |
<<: *devfair_host |
These code come from the Tensorflow documentation the (experimental) new Dataset
API.
General types:
- one_shot
- initializable
- reinitializable
- feedable