Skip to content

Instantly share code, notes, and snippets.

if 1:
model = make_rnn(num_features, num_targets, num_timesteps, num_units)
model.fit(features, targets, epochs=10, batch_size=24, validation_split=0.2)
model.save(FNAME_MODEL)
else:
model = kem.load_model(FNAME_MODEL)
time_stage_change = 15.
num_production_history = 8 # number of productin history points used for prediction
time, production, stage = calc_two_stage_decline(p0, exp_stage_zero, exp_stage_one, time_max,
time_stage_change, num=num_timesteps)
features = np.full((1, num_timesteps, num_features), NA)
features[0, :num_production_history, ifeature_production] = production[:num_production_history]
features[0, :, ifeature_stage] = stage[:]
normalizer_features.transform(features.reshape(num_timesteps, num_features))
targets = model.predict(features)
ghci> (0.3+0.2)+0.1
0.6
ghci> 0.3+(0.2+0.1)
0.6000000000000001
@philippslang
philippslang / launch.json
Created July 6, 2018 10:28
VS Code pytest debugging settings
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: loadbalancer test",
"type": "python",
"request": "launch",
"module": "pytest",
"args": [
"--no-cov"
@philippslang
philippslang / notify.js
Created July 9, 2018 14:58
Azure lambda post
var request = require('request');
module.exports = function(context, perf) {
request('http://ixciperf.westeurope.cloudapp.azure.com:5000/api/update', function (error, response, body) {
if (error) {
context.log(error);
}
if (!error && response.statusCode == 200) {
context.log("JavaScript blob trigger function processed blob \n Name:", context.bindingData.name, "\n Blob Size:", perf.length, "Bytes");
@philippslang
philippslang / settings.json
Created July 19, 2018 08:41
VS Code Python - Exclude search and watch
{
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/venv/**": true,
"**/.git/**": true,
},
"files.watcherExclude": {
"**/.git/**": true,
"**/venv/**": true