Fluid simulation with dynamic Boltzmann machine in batch manner Kun Zhao IBM Research - Tokyo Tokyo, Japan [email protected]

Takayuki Osogami IBM Research - Tokyo Tokyo, Japan [email protected]

Rudy Raymond IBM Research - Tokyo Tokyo, Japan [email protected]

Abstract Due to the complexity of solving Navier-Stokes equations, fluid simulation requires a significant amount of computational resources. In recent work [1], a machine learning technique has been applied not only to approximate but also to accelerate this complex and time-consuming computation. However, the prior work has not fully taken into account the fact that fluid dynamics is time-varying and involves dynamic features. In this work, we use a time-series machine learning technique, specifically the dynamic Boltzmann machine (DyBM) [6], to approximate fluid simulations. To enhance the training performance and accuracy, we develop a batch learning manner for DyBM instead of online learning and also add a low-rank approximation for reduced memory use and faster inference. We also propose a learning algorithm for DyBM to better learn and generate an initial part of the time-series. The experimental results suggest the efficiency and accuracy of our proposed techniques.

1

Introduction

Fluid simulation appears in various scientific simulations and computer graphic films. However, it requires a large amount of computational resources, because numerical solutions to Navier-Stokes equations are computationally expensive. To accelerate the simulation, many approximate algorithms have been proposed. Recently, machine learning techniques are also used to model this complex computation (e.g. [Ladický et al., 2015]). However, although fluid dynamics can be time-varying and dependent on historical states, only the latest state has been considered in the prior work. In this work, we use a time-series machine learning technique called the dynamic Boltzmann machine (DyBM) [6] to approximate fluid simulations. The DyBM can handle dynamic patterns and learn their dynamics via a learning rule that has the properties of spike-timing dependent plasticity, which is suitable for learning time-series of very high dimensions. We believe this feature makes the DyBM particularly suitable to model dynamic fluid simulations. However, there are two problems to address to use DyBM in fluid simulation. First, traditional DyBM learn time-series patterns in an online manner. This can cost much time to perform training process. We solve this problem by developing a batch-based learning manner for DyBM and implement a low-rank approximation to reduce memory space and to accelerate inference. Moreover, the traditional DyBM does not necessarily perform well on an initial part of a time-series. To reduce the error in approximate simulation by a DyBM, we propose a learning framework for the DyBM to handle the initial part separately. As a result, our proposed technique can learn to quickly simulate the dynamics of fluid with a small error of approximation. We conducted experiments of learning fluid simulations and compared the proposed method against the one with a conventional static machine learning model. The results demonstrate the efficiency and accuracy of our proposed method. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA.

Figure 1: Basic structure of a dynamic Boltzmann machine.

2 2.1

Proposed method Review of dynamic Boltzmann machine

A DyBM is derived from a Boltzmann machine but also involves conduction delay and memory units, which are illustrated in Figure 1. A neuron is connected to another via a synapse after a delay consisting of a constant period, dij (delay). A first-in first-out (FIFO) queue causes this conduction delay and stores the values of the pre-synaptic neuron for the last dij − 1 units of time. The value of the pre-synaptic neuron is given to the post-synaptic neuron after the conduction delay. Moreover, the DyBM aggregates information about the spikes in the past into neural eligibility traces and synaptic eligibility traces, which are stored in the memory units. In the training process, the parameters (weights associated with FIFO queues and eligibility traces as well as bias) are optimized to decrease the energy of the DyBM. After many iterations of training, dynamic patterns can be learned. In the generation process, preceding dij − 1 steps time-series (in the FIFO queues) and the values stored in the eligibility traces are used as input to generate the next pattern. For more details, refer the original paper [6, 5, 4], and an accompanying technical report [7], especially Section 5.3 on Dynamic Boltzmann Machine for real-valued time series. Let the timeseries dataset be (x[1] , . . . , x[t] , ...), where each x[t] is a vector of dimension n, i.e., x[t] ∈ Rn . The (Gaussian) Dynamic Boltzmann Machine (or simply, DyBM) is trained to compute µ[t] ∈ Rn , which is its prediction value for x[t] as follows.

[t]

µ

=b+

d−1 X

[δ] [t−δ]

W x

δ=1

+

K X

.

(1)

k=1

[t−1]

[t−1]

Here, αk are the synaptic eligibility traces defined as αk fixed values 0 ≤ λk < 1. 2.2

[t−1]

Uk αk

=

Pt−d

s=−∞

λt−s−d x[s] for some k

DyBM for real-valued time series of fluid simulation

To learn fluid simulation with DyBM, we need to address two important problems. First, DyBM learns time-series datasets in an online way, i.e., it repeatly reads the time-series input to learn its internal parameters (the b, W[δ] , and Uk ). This means, if we use DyBM as it is, we need to repeatedly read the input data until DyBM sufficiently learns it to predict the output at later time steps. Although this online learning can be made memory efficient, it can raise the issue of learning time, as DyBM may require large number of epochs (each for reading the input sequence), and at the moment there is no systematic rule of thumb to determine the number of epochs required to learn the input data with required precision. We handle the first problem by making DyBM learn its input in a batch manner. Namely, we seek to find µ[t] that best approximates x[t] in a similar fashion to the Vector Auto Regression (VAR). Let us 2

Figure 2: Generation process with trained DyBMs. Only initial state T0 of fluid is given as a cue to generate dynamics of the fluid. define a smooth function f , that denotes the sum of squared prediction error of DyBM, as follows.

2 d−1 K

X X X

[t] [t−1] [1] [δ−1] [δ] [t−δ] f (b, W , . . . , W , U1 , . . . , UK ) = W x − Uk αk .

x − b −

t k=1 δ=1 2 (2) To avoid overfitting in learning the internal parameters of DyBM, we use the regularizer function Rp , as defined below. d−1 K

X X

[j] Rp (W[1] , . . . , W[δ−1] , U1 , . . . , UK ) = λ1 kUk kp , (3)

W + λ2 j=1

p

k=1

where p = 0, 1, 2 denote the Lp -norm respectively, and λ1 , λ2 denote the regularization strength. The batch DyBM is then optimized by solving the following minimization problem. min f (b, W[1] , . . . , W[δ−1] , U1 , . . . , UK ) + Rp (W[1] , . . . , W[δ−1] , U1 , . . . , UK )

(4)

Note that in the above formulation, the resulting DyBM requires O(n + (d − 1)n2 + Kn2 ) space to store its internal parameters, each from the b, W[δ] , and Uk , respectively. We can further reduce the space by imposing low-rank conditions on W[δ] ’s and Uk ’s. The low-rank matrices approximation can be obtained easily by standard techniques, such as, the singular-value decomposition [9, 3]. Let r be the rank used in the low-rank approximation, the DyBM with low-rank conditions only requires O(n + (d − 1)nr + Knr) space, which is linear in the dimension n of the time-series input for fixed d, K, and r. Second, a fluid simulation is performed from given initial conditions and continues for a period specified by a user. A DyBM can learn to predict the next state of the fluid given its preceding states. In this work, we ignore eligibility traces and use only FIFO queues as the memory units of a DyBM. The DyBM then predicts the next state on the basis of the preceding states for the last d − 1 time-steps. However, in standard fluid simulations, only the initial state of the fluid is given, and its following states need to be predicted solely from the initial state. This means that the traditional DyBM cannot be used directly for a simulation from the initial state. To enable a simulation with a DyBM from the initial state of fluid, we propose a framework for carefully handling the initial part of the time-series in the learning and generation processes (Figure 2). In the learning process, we train multiple DyBMs with different delays. The delays are integers with a range from 2 to an optimized value of m, where m is the largest delay needed to learn the dynamics of fluid under consideration. The DyBMs with a delay of 2 to m − 1 are used to handle the initial time-series, and the DyBM with a delay of m is used to handle the rest of the time-series. In the generation process, these trained DyBMs are used to generate a time-series of the states of the fluid given its initial state T0 only (see the top part of Figure 2). This initial state contains the 3

Figure 3: DyBM generated fluid simulation. Top figure show the initial state. Other figures show how the fluid behaves of 21th, 39th, 304th time step, after simulation started.

start locations of particles that form the fluid. From the initial state T0 , the DyBM with d = 2 is used to predict the next state T1 . This predicted T1 and the initial state T0 are then used as the input to the DyBM with d = 3 to predict T3 . This process continues with an increased delay (Figure 2). Note that, after Tm is generated, we keep using the DyBM with d = m to generate the rest of the time-series of the fluid state.

3

Experiments

In our experiments, we first created training data by simulating the dynamics of fluid in a container by a standard method of smoothed-particle hydrodynamics (SPH) [2] from the initial positions of particles shown in the left-most panel of Figure 3. The container was sized as 20.0, 20.0, and 10.0 in x, y, and z axis, respectively. This data was then used to train DyBMs with different delays. The maximum delay used in this experiment is m = 3. The simulation data consists of the positions of 1,656 particles (4,968 variables for x, y, z coordinates) for 400 time-steps. We conducted this experiment on a notebook PC with an Intel Core i5 CPU (1.6 GHz) and 8 GB of system memory. We use Python 2.7 to perform the experiments. In this experiment, the simulation with SPH took about 210 seconds. On the other hand, the batch DyBM without low-rank approximation can generate the entire fluid dynamics with only 25.0 seconds after 10.8 seconds training. When we use the low-rank approximation inside batch DyBM, the generation time for the entire simulation can be decreased to 15.0 seconds with the same training time. Note that, with the low-rank approximation, we also need time to extract low-rank matrix. In this experiment, the low-rank matrix extraction cost about 665.3 seconds. The root mean square error (RMSE) of the approximately simulated positions of the particles was 1.02 × 10−6 for no low-rank approximation and 0.82 for low-rank approximation, separately. As shown in Figure 3, the simulation generated by DyBM with low-rank approximation gives a good appearance for dynamic fluid features. As a comparison, we also conducted an experiment using the standard linear regression model instead of a DyBM. The linear regression model uses only the preceding state of particles to predict the next state of those particles without taking into account the dynamic features, which were used by the DyBM. The approximate simulation with the linear regression model resulted in the RMSE of 2.21 × 1057 . This huge error is because the linear regression only considers the static feature and does not have the capability to model the whole simulation. Particles diffused very roughly in the simulation modeled by linear regression, due to the learning’s inability to converge into stable parameters.

4

Conclusions

In this work, we proposed a machine learning-based dynamic fluid approximation method with the dynamic Boltzmann machine. We developed a low-rank approximated batch learning for DyBM instead of online learning and also proposed a learning algorithm for DyBM to better learn and generate an initial part of the time-series. We conducted an experiment to model a SPH-based fluid simulation. The experimental results show that our proposed method can get a much faster speed to generate the simulation while maintaining a much better accuracy than a traditional static machine learning model[8]. 4

Acknowledgments This work was supported by JST CREST Grant Number JPMJCR1304, Japan.

References [1] L’ubor Ladicky, SoHyeon Jeong, Barbara Solenthaler, Marc Pollefeys, and Markus Gross. Datadriven fluid simulations using regression forests. ACM Trans. Graph., 34(6):199:1–199:9, October 2015. [2] L. B. Lucy. A numerical approach to the testing of the fission hypothesis. Astronomical Journal, 82:1013–1024, December 1977. [3] Gilles Meyer, Silvere Bonnabel, and Rodolphe Sepulchre. Regression on fixed-rank positive semidefinite matrices: A riemannian approach. Journal of Machine Learning Research, 12:593– 625, 2011. [4] T. Osogami. Gaussian dynamic Boltzmann machines: Autoregression via spike-timing dependent plasticity. 2016. [5] T. Osogami and S. Dasgupta. Learning the values of the hyperparameters of a dynamic Boltzmann machine. IBM Journal of Research and Development, 61(4/5):to appear, 2017. [6] T. Osogami and M. Otsuka. Seven neurons memorizing sequences of alphabetical images via spike-timing dependent plasticity. Scientific Reports, 5:14149, 2015. [7] Takayuki Osogami. Boltzmann machines for time-series. CoRR, abs/1708.06004, 2017. [8] Timo Teräsvirta. An introduction to univariate garch models. SSE/EFI Working Paper Series in Economics and Finance 646, Stockholm School of Economics, 2006. [9] Shuo Xiang, Yunzhang Zhu, Xiaotong Shen, and Jieping Ye. Optimal exact least squares rank minimization. In Proceedings of the 18th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’12, pages 480–488, New York, NY, USA, 2012. ACM.

5

Fluid simulation with dynamic Boltzmann machine in ...

rudyhar@jp.ibm.com. Abstract. Due to the complexity of solving Navier-Stokes equations, fluid simulation requires a significant amount of computational resources. In recent work [1], a machine ... Fluid simulation appears in various scientific simulations and computer graphic films. However, it requires a large amount of ...

356KB Sizes 0 Downloads 132 Views

Recommend Documents

Introduction to Fluid Simulation - GitHub
upon the notes for a Siggraph course on Fluid Simulation[Bridson. 2007]. I also used .... “At each time step all the fluid properties are moved by the flow field u.

Dynamic Boltzmann Machines for Second Order ...
extend the VAR models. We show that, similar to the GARCH(1, 1) model that gives a closed-form equation of n-step ahead of variance prediction, the extended G-DyBM can yield a similar, albeit. *This work was done while the author was at IBM Research

3-D Thermal Simulation with Dynamic Power Profiles
Dept. of Electrical Engineering, KAIST. Daejeon 305-701, Korea. Youngsoo Shin. Dept. of ... have been emerging as important design criteria as technology is scaled down to nano-meter regime. There have ... power management techniques are employed in

3-D Thermal Simulation with Dynamic Power Profiles
and convective heat transfer coefficient, which constitute a boundary condition, as another input to the simulator. From these inputs, the simulator tries to solve the heat conduction equation, which is the governing equation for calculation of heat

Particle-based Viscoelastic Fluid Simulation
and can animate splashing behavior at interactive framerates. Categories and ..... We can visualize how the combined effect of pressure and near-pressure can ...

Numerical Simulation of Nonoptimal Dynamic ...
Computation of these models is critical to advance our ..... Let us now study the model specification of Example 2 in Kubler and Polemarchakis ..... sequentially incomplete markets, borrowing constraints, transactions costs, cash-in-advance.

Physical scales in the Wigner–Boltzmann equation - Semantic Scholar
Oct 9, 2012 - the application of quantum physics to information theory has enlarged the interest in sources and ...... 160, IOS Press, Amsterdam, 2005, pp.

anon, Boltzmann Equation.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying.

2D Fluid Simulation based on Voronoi Regions
Intel(R) Core (TM) 2 Duo CPU 1.6Ghz(2CPUs),. CPU Memory: 2046 MB RAM, Nvidia GeForce. 8400M GS with 128MB video memory. OpenGL was used as the graphics API library. We used 2400 particles (a total of 4800 particles. + the boundary particles) for each

Numerical Simulation of Heat Transfer and Fluid Flow ...
other types of fuel cells have to rely on a clean supply of hydro- gen for their operation. ... cathode and the anode is related to the Gibbs free energy change.

Read Fluid Power with Applications
Read Fluid Power with Applications

Modelling and simulation of fluid-structure interactions ...
range of 20–320 Hz with a mean of 89 Hz by Brietzke and Mair (2006). 3 RESULTS & ..... 19–49. Springer. oomph-lib is available as open-source software at:.

Approximate Dynamic Programming using Fluid and ...
Integr. Circuits Syst., 24(12):1827–1837, December 2005. [35] Sushu Zhang and K. S. Catha. Approximation algorithm for the temperature-aware scheduling problem. In Proc. IEEE Int. Conf. Comp. Aided Design, pages 281–288, November 2007. [36] Yifan

development of a dynamic simulation tool for the ...
Space Agency (ESA) ExoMars mission, will require rovers to travel further, faster, ... on-board software, or operator-in-the-loop simulations. Although ROAMS ...

dynamic-simulation-and-control-of-a-supercritical-co2-power ...
... parameters provide the. Page 3 of 25. dynamic-simulation-and-control-of-a-supercritical-co2-p ... n-system-for-small-light-water-reactor-applications.pdf.