This file contains hidden or 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
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: {} |
This file contains hidden or 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
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 |