Skip to content

Instantly share code, notes, and snippets.

def shift_bhw1_into_bhwn(images1c, shifts):
"""Shifts images horizontally and back-fills with zeros.
@param images: [batch_size, height, width, channels=1]
@param shifts: [batch_size, n_shifts]
@output [batch_size, height, width, channels=n_shifts]
"""
images = tf.tile(images1c, [1, 1, 1, shifts.shape[1]]) # create n_sample_distances channel copies
left = tf.maximum(0, tf.reduce_max(shifts)) # positive numbers are shifts to the right, for which we need to add zeros on the left
right = -tf.minimum(0, tf.reduce_min(shifts)) # negative numbers are shifts to the left, for which we need to add zeros on the right
@skosch
skosch / grafana_dashboard.json
Last active January 23, 2022 01:18
Very simple Grafana dashboard for Prometheus Elixir metrics
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
// meteor algorithm to check if this is a meteor serving http request or not
function IsAppUrl(req) {
var url = req.url;
if(url === '/favicon.ico' || url === '/robots.txt') {
return false;
}
// NOTE: app.manifest is not a web standard like favicon.ico and
// robots.txt. It is a file name we have chosen to use for HTML5
// appcache URLs. It is included here to prevent using an appcache
predicate maximum_int(var int: m,array [int] of var int: x);
predicate minimum_int(var int: m,array [int] of var int: x);
array [1..8] of int: X_INTRODUCED_313 = [1,1,1,1,1,1,1,1];
array [1..4] of int: X_INTRODUCED_538 = [-1,-1,-1,-1];
array [1..14] of int: X_INTRODUCED_633 = [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];
array [1..7] of int: X_INTRODUCED_657 = [1,-1,-1,-1,-1,-1,-1];
array [1..11] of int: X_INTRODUCED_675 = [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];
array [1..8] of int: X_INTRODUCED_699 = [1,-1,-1,-1,-1,-1,-1,-1];
array [1..6] of int: X_INTRODUCED_716 = [1,-1,-1,-1,-1,-1];
array [1..5] of int: X_INTRODUCED_741 = [1,-1,-1,-1,-1];