forked from yarik1988/Tensorflow_ODE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSampleModel.py
More file actions
28 lines (23 loc) · 782 Bytes
/
SampleModel.py
File metadata and controls
28 lines (23 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import numpy as np
import tensorflow as tf
class SampleModel:
def __init__(self, func_tf, func, interval, pos, val, theoretical=None):
self.tf_equation = func_tf
self.equation = func
self.interval = interval
self.T = interval
self.pos = pos
self.val = val
self.theoretical = theoretical
self.dim = len(val)
self.orders = []
for i in pos:
self.orders.append(len(i))
self.max_order = np.max(self.orders)
self.equations_amount = len(pos)
def get_pos(self, equation_idx):
return self.pos[equation_idx]
def get_val(self, equation_idx):
return self.val[equation_idx]
def get_init_point(self, index):
return self.init_points[index]