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
{{ define "slack.default.title" }} | |
[ {{ .Status | toUpper }} ] | |
{{ end }} | |
{{ define "slack.default.message" }} | |
{{ range . }} | |
{{ if gt (len .Annotations.summary) 0 }}Alert Summary: {{ .Annotations.summary }} {{ end }} | |
{{ if gt (len .Annotations.runbook_url) 0 }}Alert Runbook: {{ .Annotations.runbook_url }} {{ end }} | |
Labels: |
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
""" | |
How to do minibatches for RNNs in pytorch | |
Assume we feed characters to the model and predict the language of the words. | |
""" | |
def prepare_batch(x, y): | |
# determine the maximum word length per batch and zero pad the tensors | |
n_max = max([a.shape[0] for a in x]) |