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
def make_rnn(num_features, num_targets, num_timesteps, num_units): | |
model = kem.Sequential() | |
model.add(kel.LSTM(num_units, input_shape=(num_timesteps, num_features), return_sequences=True)) | |
model.add(kel.TimeDistributed(kel.Dense(num_targets, activation='sigmoid'))) | |
model.compile(loss='mse', optimizer='adam') | |
return model |
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
def calc_exponential_decline(p0, exp, time): | |
return p0 * np.exp(-exp * time) | |
def calc_two_stage_decline(p0, exp_stage_zero, exp_stage_one, time_max, time_next_stage, time_min=0., | |
production_jumpfactor=4., num=50, noise=0.1, noise_mean=1.): | |
time = np.linspace(time_min, time_max, num) | |
stage_one = np.where(time > time_next_stage) | |
production = calc_exponential_decline(p0, exp_stage_zero, time) * np.random.normal(noise_mean, noise, time.shape) | |
time_stage_one_relative = np.linspace(time_min, time_max-time_next_stage, len(time[stage_one])) | |
production[stage_one] = calc_exponential_decline(production[stage_one][0] + p0/production_jumpfactor, exp_stage_one, |
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 numpy as np | |
import keras.models as kem | |
import keras.layers as kel | |
import sklearn.preprocessing as preproc | |
np.random.seed(42) | |
FNAME_MODEL = 'tmp/decl_curve_rnn.h5' |
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
ic_load_tetin ./out.tin | |
set srfcs [ic_geo_get_objects surface] | |
ic_curve intersect STANDARD crv.00 $srfcs | |
set crvs [ic_geo_get_objects curve] | |
ic_geo_create_curve_ends $crvs | |
ic_save_tetin flow.tin | |
ic_geo_scale_meshing_params all 0.9 | |
ic_set_meshing_params global 0 gref 0.9 gmax 9.0 gfast 1 gedgec 0.2 gnat 0 gcgap 1 gnatref 10 |
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
function [hmame, hmami] = Ellipsoid_discs_plot(vma, vme, vmi) | |
%Ellipsoid_discs_plot plots an ellipsoid as two | |
%elliptical discs. | |
% | |
%The center of the ellipsoid is assumed to be 0,0,0. The tool has been | |
%designed to visualize tensorial properties using the characteristic | |
%Eigenvectors. Using cross-section elliptical discs to visualize ellipsoids | |
%may provide improved visualization compared to volumetric ellipsoids. | |
% | |
% Parameters |
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
void demo(size_t nr, size_t nc, double *arr) | |
{ | |
for(int r(0); r < nr; ++r) | |
for(int c(0); c < nc; ++c) | |
arr[r*nc+c] = 1.; // fills arr[r][c] | |
} |
NewerOlder