コード例 #1
0
    def __init__(self, options):
        self.options = options
        self.grid_size = int(options['mesh_size'][0] / options['downsample_by'])
        self.max_domain = 2 * np.pi  # Not variable for now. Domain is fixed to [0, 2*pi]x[0, 2*pi]
        self.filter_size = options['filter_size']
        self.batch_size = options['batch_size']
        self.dt = options['dt']
        self.boundary_cond = options['boundary_cond']
        self.max_order = options['max_order']
        self.iterations = options['iterations']

        # Number of filters:
        self.N = int((self.max_order + 2) * (self.max_order + 1) / 2)

        # Positioning the 1 in the moment-matrices
        self.ind = mm.index(self.filter_size)

        self.coefs = []  # Storing the coefficients here
        self.M = []  # Storing the moment-matrices here

        # Generating the data
        self.batch, self.inits = gd.generate(options)
コード例 #2
0
    def __init__(self, options):
        self.options = options
        self.grid_size = 50  # Only fixed it to 50 for this test. Shouldn't do it in general!
        self.max_domain = 2 * np.pi  # Not variable for now. Domain is fixed to [0, 2*pi]x[0, 2*pi]
        self.filter_size = options['filter_size']
        self.batch_size = options['batch_size']
        self.dt = options['dt']
        self.boundary_cond = options['boundary_cond']
        self.max_order = options['max_order']
        self.iterations = options['iterations']

        # Number of filters:
        self.N = int((self.max_order + 2) * (self.max_order + 1) / 2)

        # Positioning the 1 in the moment-matrices
        self.ind = mm.index(self.filter_size)

        self.coefs = []  # Storing the coefficients here
        self.M = []  # Storing the moment-matrices here

        # Generating the data
        self.batch, self.inits = gd.generate(
            options, method='low_freq')  # For inference