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
print_lcp_config_options | |
struct netdissect_options * TypeKind.POINTER arg declared in ./tcpdump/print-ppp.c:L403,C39-L403,C59 netdissect_options declared in ./tcpdump/netdissect.h:L161 | |
const unsigned char TypeKind.ELABORATED arg declared in ./tcpdump/print-ppp.c:L403,C61-L403,C73 u_char declared in /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_types/_u_char.h:L30 | |
const unsigned int TypeKind.ELABORATED arg declared in ./tcpdump/print-ppp.c:L403,C75-L403,C86 u_int declared in /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_types/_u_int.h:L30 | |
print_ipcp_config_options | |
struct netdissect_options * TypeKind.POINTER arg declared in ./tcpdump/print-ppp.c:L404,C40-L404,C60 netdissect_options declared in ./tcpdump/netdissect.h:L161 | |
const unsigned char * TypeKind.POINTER arg declared in ./tcpdump/print-ppp.c:L404,C62-L404,C77 u_char declared in /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_types/_u_char.h:L30 | |
unsigned int TypeKind.ELABO |
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
# gcr.io/kaggle-images/python:latest | |
# checked on April 21 2023 | |
# root@9735f873cb2d:/# pip list show | |
Package Version Editable project location | |
-------------------------------------- -------------- ------------------------- | |
absl-py 1.4.0 | |
accelerate 0.12.0 | |
access 1.1.9 | |
affine 2.4.0 | |
aiobotocore 2.5.0 |
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
# Read more about SSH config files: https://linux.die.net/man/5/ssh_config | |
Host snarto_kaggle_cpu | |
# update the instance IP under console.cloud.google.com/compute/instances -> more (...) -> network details | |
HostName 34.170.120.99 | |
# add the public part under console.cloud.google.com/compute/metadata | |
IdentityFile ~/.ssh/id_rsa | |
# match the name under the SSH key | |
User maciej.skorski | |
Port 22 |
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
# wrap the TF code to be profiled with <start> and <stop> methods as below | |
tf.profiler.experimental.start('logs/profile') | |
for (x,y) in data: | |
train_step(x,y) | |
tf.profiler.experimental.stop() |
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
## train a logistic regression (images 28x28 and 10 classes) | |
w = tf.Variable(tf.random.normal(shape=(28*28,10),stddev=0.1),trainable=True) | |
optimizer = tf.optimizers.SGD(0.01) | |
@tf.function | |
def train_step(x, y): | |
with tf.GradientTape() as tape: | |
all_logits = tf.matmul(x,w) # (n_batch,n_class) | |
y_logits = tf.gather(all_logits,y,batch_dims=1) # (n_batch,) |
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
def SparseCategoricalCrossentropy(labels,logits): | |
''' labels: shape [n_batch] contains true classes as numbers from 0 to n_classes-1 | |
logits: shape [n_batch,n_classes], predicted log probabilities ''' | |
Z = tf.reduce_logsumexp(logits,axis=-1) | |
lookup_labels = tf.stack([tf.range(tf.shape(labels)[0]),tf.cast(labels,tf.int32)],1) | |
true_logits = tf.gather_nd(logits,lookup_labels,batch_dims=0) | |
return -true_logits + Z |
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
from itertools import islice,chain | |
from collections import deque | |
def gen_skipgrams(itr,window=1,symmetric=False,Q=None): | |
itr = iter(itr) | |
if not Q: | |
Q = deque(islice(itr,window-1),maxlen=window) | |
append = Q.append | |
for i in itr: | |
for j in Q: |