Skip to content

Instantly share code, notes, and snippets.

View maxi-w's full-sized avatar

Maxi maxi-w

  • Berlin
View GitHub Profile
@beevelop
beevelop / nr.js
Created March 9, 2020 19:04
Node-RED embedded (standalone)
var RED = require("node-red");
var importedFlows = require('./flows.json')
const path = require('path');
// Create the settings object - see default settings.js file for other options
var settings = {
httpNodeRoot: false,
httpAdminRoot: false,
userDir: path.join(__dirname, ".nodered"),
functionGlobalContext: {}
import math
from torch.optim.optimizer import Optimizer
# This version of Adam keeps an fp32 copy of the parameters and
# does all of the parameter updates in fp32, while still doing the
# forwards and backwards passes using fp16 (i.e. fp16 copies of the
# parameters and fp16 activations).
#
# Note that this calls .float().cuda() on the params such that it
# moves them to gpu 0--if you're using a different GPU or want to