JP2019079291A - Matrix decomposition device and matrix decomposition method - Google Patents

Matrix decomposition device and matrix decomposition method Download PDF

Info

Publication number
JP2019079291A
JP2019079291A JP2017205934A JP2017205934A JP2019079291A JP 2019079291 A JP2019079291 A JP 2019079291A JP 2017205934 A JP2017205934 A JP 2017205934A JP 2017205934 A JP2017205934 A JP 2017205934A JP 2019079291 A JP2019079291 A JP 2019079291A
Authority
JP
Japan
Prior art keywords
matrix
search
vector
real
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2017205934A
Other languages
Japanese (ja)
Other versions
JP6889087B2 (en
Inventor
悠一 吉田
Yuichi Yoshida
悠一 吉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso IT Laboratory Inc
Original Assignee
Denso IT Laboratory Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso IT Laboratory Inc filed Critical Denso IT Laboratory Inc
Priority to JP2017205934A priority Critical patent/JP6889087B2/en
Publication of JP2019079291A publication Critical patent/JP2019079291A/en
Application granted granted Critical
Publication of JP6889087B2 publication Critical patent/JP6889087B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Complex Calculations (AREA)

Abstract

To reduce loads of calculation for decomposing a real-number matrix.SOLUTION: A matrix decomposition device 10 that decomposes a real-number matrix W into a product of a basis matrix M composed of discrete values and a coefficient matrix C composed of real-numbers comprises: a vector extraction unit 12 that extracts a real-number vector b of each row of the real-number matrix W; a coefficient matrix determination unit 13 that determines the coefficient matrix C; an optimum solution search unit 14 that obtains an optimum solution vector m of each row of the basis matrix M corresponding to the real-number vector b of each extracted row using the determined coefficient matrix C; and a decomposition matrix output unit 17 that combines an optimum solution vector m of each row obtained by the optimum solution search unit 14 to output as the basis matrix M and that outputs the coefficient matrix C used in obtaining the basis matrix M. The optimum solution search unit 14 performs hybrid search repetitively switching Monte Carlo tree search and branch-and-bound search alternately while taking over a search tree and provisional minimum error.SELECTED DRAWING: Figure 1

Description

本発明は、実数で構成される行列を、実数値を持つ行列と整数値のみを持つ行列との積に分解する行列分解装置及び行列分解方法に関する。   The present invention relates to a matrix factorization apparatus and matrix factorization method that decomposes a matrix composed of real numbers into a product of a matrix having real numbers and a matrix having only integer numbers.

画像認識の演算には、実数で構成されるベクトル(実数ベクトル)と実数で構成される行列(実数行列)との積演算が含まれることがある。例えば、SVM(Support Vector Machine)には、実数ベクトルである特徴ベクトルと、実数行列である重み行列との積演算が含まれ、CNN(Convolutional Neural Network)には、実数ベクトルである入力層(ベクトル)と実数行列である畳み込みフィルタ(行列)との積演算が含まれる。このような実数ベクトルと実数行列との積演算の演算負荷は大きく、即ち長い演算時間を要し、かつ、メモリ消費量が大きくなる。   The image recognition operation may include a product operation of a vector composed of real numbers (real vector) and a matrix composed of real numbers (real matrix). For example, SVM (Support Vector Machine) includes a product operation of a feature vector which is a real vector and a weighting matrix which is a real matrix, and a CNN (Convolutional Neural Network) has an input layer (vector) which is a real vector. And a convolution filter (matrix) which is a real matrix. The calculation load of the product calculation of such a real number vector and a real number matrix is large, that is, it takes a long calculation time, and the memory consumption becomes large.

そこで、従来より、実数ベクトルを整数値のみを持つベクトルに変換するとともに、実数行列を整数値のみを持つ基底行列と実数値を持つ係数行列との積に分解することで積演算の負荷を軽減することが提案されている。   Therefore, conventionally, while converting a real vector to a vector having only integer values, the load of product operation is reduced by decomposing a real matrix into a product of a base matrix having only integer values and a coefficient matrix having real values. It has been proposed to do.

実数行列Wを係数行列Cと基底行列Mに分解する問題は、以下の式(1)に帰着できる。

Figure 2019079291
The problem of decomposing a real number matrix W into a coefficient matrix C and a basis matrix M can be reduced to the following equation (1).
Figure 2019079291

この問題の最適解を求めるには、基本的には、すべての解を探索する必要があるが、問題のサイズによっては天文学的な計算時間を要することもある。そこで、この問題を解くための既存手法としていくつかのアプローチがある。   In order to find an optimal solution to this problem, basically it is necessary to search all solutions, but depending on the size of the problem, astronomical calculation time may be required. Therefore, there are several approaches as existing methods for solving this problem.

まず、この問題は、制約付き最適化問題と捉えることができるので、分枝限定法で解くことが可能である。分枝限定法は、要素をすべて決定する途中の段階で制約なし最適化問題として残りの要素が実現し得る最小の制約なし誤差を計算する。この最小の制約なし誤差よりも現在得られている最小の誤差(暫定最小誤差)の方が小さければ、残りの要素の如何に関わらず、暫定最小誤差よりも誤差を小さくする解は得られないことになり、探索木の枝刈りが可能となる。分枝限定法は、このような枝刈りによって探索範囲を決定論的に狭めていき、探索すべき枝がなくなったときに、そのときの暫定最小誤差を実現する組み合わせを大域最適値として出力する。   First, since this problem can be regarded as a constrained optimization problem, it can be solved by the branch and bound method. The branch and bound method calculates the smallest unconstrained error that the remaining elements can realize as an unconstrained optimization problem in the process of determining all the elements. If the currently obtained minimum error (temporary minimum error) is smaller than this minimum unconstrained error, regardless of the remaining elements, no solution can be obtained that makes the error smaller than the temporary minimum error. It becomes possible to prun the search tree. The branch and bound method narrows the search range deterministically by such pruning, and outputs a combination that realizes the temporary minimum error at that time as a global optimum when there is no branch to be searched. .

また、確率的なアプローチとして、モンテカルロ木探索がある(例えば、特許文献1)。モンテカルロ木探索は、すべての解を探索することを諦めて、確率的に良い解を得ようとするアプローチである。なかでも、UCT(Upper Confidence Bounds for Trees)と呼ばれる手法が囲碁を指す人工知能などで応用され、高い性能を持つことが知られている。   Moreover, there is a Monte Carlo tree search as a probabilistic approach (for example, Patent Document 1). The Monte Carlo tree search is an approach that seeks to obtain a probabilistically good solution by giving up searching for all solutions. Above all, it is known that a method called UCT (Upper Confidence Bounds for Trees) is applied in artificial intelligence or the like pointing to Go, and has high performance.

UCTでは、探索当初は乱数的に値を探索していくが、探索が進んでくると、過去の誤差の履歴からの選択によって得られる誤差の期待値を計算し、0と1の中から小さい誤差が得られそうな候補を選んで探索する。さらに、期待値だけでは偶然小さい誤差が得られた場合には全く探索されない要素が出てくる可能性もある。このため、過去に選ばれた回数が少ない要素が優先的に選ばれるように、期待値に重み付けがされる。   In UCT, values are searched randomly at the beginning of the search, but when the search progresses, the expected value of the error obtained by selection from the history of the past errors is calculated, and it is small from 0 and 1 Search for a candidate that is likely to get an error. In addition, there is also a possibility that there is an element that can not be searched at all if an expected value alone results in an accidental small error. For this reason, the expected value is weighted such that an element with a small number of times selected in the past is preferentially selected.

特開2014−142849号公報JP, 2014-142849, A

分枝限定法は、上述のように厳密に大域最適解が得られるという利点があるが、枝刈りがうまくいかない場合には、演算時間が大きくなりすぎるという問題がある。すなわち、分枝限定法では、早期に大域最適解に近い解が得られた場合には枝刈りが効率的に進む可能性があるが、そうでなければ効率が極めて悪くなってしまう。   The branch and bound method has the advantage that the global optimum solution can be obtained strictly as described above, but there is a problem that the operation time becomes too large if the pruning does not work well. That is, in the branch and bound method, when a solution close to the global optimum solution is obtained early, there is a possibility that pruning can proceed efficiently, but otherwise the efficiency becomes extremely low.

一方、UCT等のモンテカルロ木探索では、短時間に比較的良い解が得られる利点があるが、厳密な大域最適解が得られる保証はなく、厳密解を求めるようとすれば、全探索をするよりも演算時間がかかってしまう問題がある。   On the other hand, Monte Carlo tree search such as UCT has the advantage that a relatively good solution can be obtained in a short time, but there is no guarantee that a strictly global optimal solution can be obtained. There is a problem that it takes more computation time than that.

本発明は、上記の問題に鑑みてなされたものであり、実数行列を分解するための演算負荷を軽減することを目的とする。   The present invention has been made in view of the above problems, and an object thereof is to reduce the operation load for decomposing a real number matrix.

本発明の一態様は、実数行列(W)を離散値からなる基底行列(M)と実数からなる係数行列(C)との積に分解する行列分解装置(10)であって、実数行列(W)の各行の実数ベクトル(b)を抽出するベクトル抽出部(12)と、係数行列(C)を決定する係数行列決定部(13)と、前記係数行列決定部(13)にて決定された前記係数行列(C)を用いて、前記ベクトル抽出部(12)にて抽出された各行の前記実数ベクトル(b)に対応する基底行列(M)の各行の最適解ベクトル(m)を求める最適解探索部(14)と、前記最適解探索部(14)で求められた各行の前記最適解ベクトル(m)を組み合わせて前記基底行列(M)として出力するとともに、当該基底行列(M)を得た際に用いた前記係数行列(C)を出力する分解行列出力部(17)とを備え、前記最適解探索部(14)は、探索木及び暫定最小誤差を引き継ぎつつモンテカルロ木探索と分枝限定探索とを交互に繰り返し切り替えるハイブリッド探索を行う構成を有している。   One aspect of the present invention is a matrix factorization apparatus (10) for decomposing a real number matrix (W) into a product of a basis matrix (M) consisting of discrete values and a coefficient matrix (C) consisting of real numbers, W) determined by the vector extraction unit (12) for extracting the real vector (b) of each row, the coefficient matrix determination unit (13) for determining the coefficient matrix (C), and the coefficient matrix determination unit (13) The optimal solution vector (m) of each row of the basis matrix (M) corresponding to the real vector (b) of each row extracted by the vector extraction unit (12) is determined using the coefficient matrix (C) An optimal solution search unit (14) and the optimal solution vector (m) of each row obtained by the optimal solution search unit (14) are combined and output as the basis matrix (M), and the basis matrix (M) Output the coefficient matrix (C) used when obtaining A solution matrix output unit (17), wherein the optimum solution search unit (14) performs a hybrid search that alternately switches between Monte Carlo tree search and branch-and-bound search while taking over the search tree and the provisional minimum error. Have.

この構成により、モンテカルロ木探索によって最適解に近い解を早期に探索できるので、分枝限定探索における枝刈りが効果的に進行し、分枝限定探索によって枝刈りが進むとモンテカルロ木探索でより最適解に近い解を早期に探索できるという相乗効果が得られるので、演算負荷を軽減して効果的に最適解を見つけることができる。   According to this configuration, since a solution close to the optimal solution can be searched early by Monte Carlo tree search, pruning in branch limited search effectively progresses, and if pruning proceeds by branch limited search, it is more optimal in Monte Carlo tree search Since the synergetic effect that the solution close to the solution can be searched early is obtained, the calculation load can be reduced and the optimum solution can be effectively found.

上記の行列分解装置(10)は、前記最適解探索部(14)で求められた各行の前記最適解ベクトル(m)を組み合わせて前記基底行列(M)としたときの前記分解誤差(E)が、所定の基準に基づいて十分に小さくなったか否かを判定する分解誤差判定部(16)をさらに備えていてよく、前記分解行列出力部(17)は、前記分解誤差判定部(16)にて前記分解誤差(E)が十分に小さくなったと判定されたときに、前記基底行列(M)及び前記係数行列(C)を出力してよく、前記分解誤差判定部(16)にて分解誤差(E)が十分に小さくなっていないと判定されたときに、前記係数行列決定部(13)は、新たな前記係数行列(C)を決定し、前記最適解探索部(14)は、新たな前記係数行列(C)を用いて新たな最適解ベクトルを求めてよい。この構成により、分解誤差を小さくして分解の精度を向上できる。   The above-mentioned matrix decomposition apparatus (10) is the above-mentioned decomposition error (E) when the above-mentioned optimum solution vector (m) of each row obtained by the above-mentioned optimum solution search unit (14) is combined to form the above-mentioned basis matrix (M). The apparatus may further include a decomposition error determination unit (16) that determines whether or not the value has become sufficiently small based on a predetermined standard, and the decomposition matrix output unit (17) includes the decomposition error determination unit (16). The base matrix (M) and the coefficient matrix (C) may be output when it is determined that the decomposition error (E) has become sufficiently small at step. When it is determined that the error (E) is not sufficiently small, the coefficient matrix determination unit (13) determines a new coefficient matrix (C), and the optimal solution search unit (14) New optimal solution vector using new coefficient matrix (C) It may be asked Le. With this configuration, the resolution error can be reduced to improve the resolution accuracy.

上記の行列分解装置(10)において、前記最適解探索部(14)は、前記分枝限定探索にて大域最適解ベクトルが得られるまで前記ハイブリッド探索を行い、前記大域最適解ベクトルを前記最適解ベクトルとして求めてよい。この構成により、分解誤差を小さくして分解の精度を向上できる。   In the above matrix decomposition apparatus (10), the optimum solution search unit (14) performs the hybrid search until a global optimum solution vector is obtained by the branch and bound search, and the global optimum solution vector is determined as the optimum solution May be determined as a vector. With this configuration, the resolution error can be reduced to improve the resolution accuracy.

上記の行列分解装置(10)において、前記最適解探索部(14)は、前記暫定最小誤差の更新が滞ったときに、前記モンテカルロ木探索と前記分枝限定探索とを切り替えてよい。   In the above-described matrix factorization device (10), the optimum solution search unit (14) may switch between the Monte Carlo tree search and the branch and bound search when updating of the temporary minimum error is delayed.

上記の行列分解装置(10)において、前記最適解探索部(14)は、前の切替えから所定時間が経過したときに、前記モンテカルロ木探索と前記分枝限定探索とを切り替えてよい。   In the above-described matrix decomposition apparatus (10), the optimum solution search unit (14) may switch between the Monte Carlo tree search and the branch-limited search when a predetermined time has elapsed since the previous switching.

上記の行列分解装置(10)において、前記最適解探索部(14)は、誤差を所定回数算出したときに、前記モンテカルロ木探索と前記分枝限定探索とを切り替えてよい。   In the above-described matrix decomposition apparatus (10), the optimal solution search unit (14) may switch between the Monte Carlo tree search and the branch and bound search when an error is calculated a predetermined number of times.

上記の行列分解装置(10)において、前記最適解探索部(14)は、前の切替えから所定時間が経過し、又は誤差を所定回数算出したときに、前記モンテカルロ木探索法と前記分枝限定探索とを切り替えてよい。   In the above-described matrix factorization apparatus (10), when the predetermined time has elapsed since the previous switching or the optimum solution search unit (14) calculates an error a predetermined number of times, the Monte Carlo tree search method and the branch limitation You may switch between searching and searching.

本発明の一態様は、実数行列(W)を離散値からなる基底行列(M)と実数からなる係数行列(C)との積に分解する行列分解方法であって、実数行列(W)を取得するステップと、前記実数行列(W)の各行の実数ベクトル(b)を抽出するステップと、係数行列(C)を決定するステップと、前記実数ベクトル(b)と前記係数行列(C)とを用いて、各行の前記実数ベクトル(b)に対する基底行列(M)の各行の最適解ベクトル(m)を求めるステップと、前記実数行列(W)から抽出されたすべての前記実数ベクトル(b)について求めた前記最適解ベクトル(m)を組み合わせて前記基底行列(M)として出力し、当該基底行列(M)を得た際に用いた前記係数行列(C)を出力するステップとを含み、前記最適解ベクトル(m)を求めるステップは、探索木及び暫定最小誤差を引き継ぎつつモンテカルロ木探索と分枝限定探索とを交互に繰り返し切り替えるハイブリッド探索を行う、行列分解方法。   One aspect of the present invention is a matrix decomposition method for decomposing a real number matrix (W) into a product of a basis matrix (M) consisting of discrete values and a coefficient matrix (C) consisting of real numbers, and the real number matrix (W) Acquiring, extracting a real number vector (b) of each row of the real number matrix (W), determining a coefficient matrix (C), the real number vector (b), and the coefficient matrix (C) Determining an optimal solution vector (m) of each row of the basis matrix (M) for each real vector (b) of each row using all the real vectors (b) extracted from the real matrix (W) And combining the optimal solution vector (m) obtained for the matrix and outputting the combined matrix as the basis matrix (M), and outputting the coefficient matrix (C) used when the basis matrix (M) is obtained. The optimal solution vector (m Step Repeated hybrid search to switch alternately and Monte Carlo tree search and branch and bound search while taking over the search tree and temporary minimum error, matrix decomposition method for obtaining the.

この構成により、モンテカルロ木探索によって最適解に近い解を早期に探索できるので、分枝限定探索における枝刈りが効果的に進行し、分枝限定探索によって枝刈りが進むとモンテカルロ木探索でより最適解に近い解を早期に探索できるという相乗効果が得られるので、演算負荷を軽減して効果的に最適解を見つけることができる。   According to this configuration, since a solution close to the optimal solution can be searched early by Monte Carlo tree search, pruning in branch limited search effectively progresses, and if pruning proceeds by branch limited search, it is more optimal in Monte Carlo tree search Since the synergetic effect that the solution close to the solution can be searched early is obtained, the calculation load can be reduced and the optimum solution can be effectively found.

本発明によれば、モンテカルロ木探索によって最適解に近い解を早期に探索できるので、分枝限定探索における枝刈りが効果的に進行し、分枝限定探索によって枝刈りが進むとモンテカルロ木探索でより最適解に近い解を早期に探索できるという相乗効果が得られるので、演算負荷を軽減して効果的に最適解を見つけることができる。   According to the present invention, since a solution close to the optimal solution can be searched early by Monte Carlo tree search, pruning in branch limited search effectively proceeds, and if pruning proceeds by branch limited search, Monte Carlo tree search Since the synergetic effect of being able to search for a solution closer to the optimum solution earlier can be obtained, the calculation load can be reduced and the optimum solution can be effectively found.

本発明の実施の形態の行例分解装置の構成を示す図The figure which shows the structure of the row example decomposition | disassembly apparatus of embodiment of this invention. 本発明の実施の形態の実数行列の分解を示す図Diagram showing decomposition of real number matrix according to the embodiment of the present invention 本発明の実施の形態の最適解探索部で用いられる探索木を示す図A diagram showing a search tree used in the optimum solution search unit of the embodiment of the present invention 本発明の実施の形態の行列分解装置にて実行される行列分解方法のフロー図Flow chart of the matrix decomposition method executed by the matrix decomposition apparatus according to the embodiment of the present invention 本発明の実施の形態の行列分解装置にて実行される最適解探索処理のフロー図Flow chart of the optimal solution search process executed by the matrix factorization apparatus according to the embodiment of the present invention

以下、図面を参照して本発明の実施の形態を説明する。なお、以下に説明する実施の形態は、本発明を実施する場合の一例を示すものであって、本発明を以下に説明する具体的構成に限定するものではない。本発明の実施にあたっては、実施の形態に応じた具体的構成が適宜採用されてよい。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. The embodiment described below shows an example in the case of practicing the present invention, and the present invention is not limited to the specific configuration described below. In the implementation of the present invention, a specific configuration according to the embodiment may be adopted as appropriate.

図1は、本発明の実施の形態の行例分解装置の構成を示す図である。図1に示す構成は、CPU、メモリ、記憶装置等を備えたコンピュータのCPUが本実施の形態の行列分解プログラムを実行することにより実現される。本実施の形態の行列分割装置10は、実数行列入力部11と、ベクトル抽出部12と、係数行列決定部13と、最適解探索部14と、切替判定部15と、分解誤差判定部16と、分解行列出力部17とを備えている。最適解探索部14は、モンテカルロ木探索部141と、分枝限定探索部142とを備えている。   FIG. 1 is a diagram showing the configuration of a row decomposition apparatus according to an embodiment of the present invention. The configuration shown in FIG. 1 is realized by the CPU of a computer including a CPU, a memory, a storage device, and the like executing the matrix decomposition program according to the present embodiment. The matrix division apparatus 10 according to the present embodiment includes a real number matrix input unit 11, a vector extraction unit 12, a coefficient matrix determination unit 13, an optimal solution search unit 14, a switching determination unit 15, and a decomposition error determination unit 16 , And a decomposition matrix output unit 17. The optimum solution search unit 14 includes a Monte Carlo tree search unit 141 and a branch-and-bound search unit 142.

図2は、実数行列の分解を示す図である。行列分解装置10は、図2に示すようにD行L列の実数行列Wを入力して、それをD行K列(Kは基底数)の離散値からなる基底行列Mと、K行L列の係数行列Cとの積に分解して、得られた基底行列Mと係数行列Cを出力する。本実施の形態では、基底行列Mは、−1と1とからなる二値行列とするが、基底行列Mは、−1、0、1からなる三値行列であっても、任意の整数からなる行列であってもよい。   FIG. 2 is a diagram showing decomposition of a real number matrix. The matrix factorization unit 10 inputs a real matrix W of D rows and L columns as shown in FIG. 2 and inputs it into a base matrix M consisting of discrete values of D rows and K columns (K is the number of bases), K rows L It is decomposed into the product of the column with the coefficient matrix C, and the obtained basis matrix M and the coefficient matrix C are output. In this embodiment, the basis matrix M is a binary matrix consisting of −1 and 1, but even if the basis matrix M is a ternary matrix consisting of −1, 0 and 1, it can be selected from any integer The matrix may be

実数行列入力部11は、外部から入力された分解すべき実数行列Wを取得する。ベクトル抽出部12は、入力された実数行列Wの各行の行ベクトルの転置ベクトルを列ベクトル(実数ベクトル)bとして抽出して、行ごとに最適解探索部14に出力する。係数行列決定部13は、係数行列Cを決定して最適解探索部14に出力する。   The real number matrix input unit 11 obtains a real number matrix W to be decomposed that is externally input. The vector extraction unit 12 extracts the transposed vector of the row vector of each row of the input real number matrix W as a column vector (real number vector) b and outputs the row to the optimum solution search unit 14 for each row. The coefficient matrix determination unit 13 determines the coefficient matrix C and outputs the coefficient matrix C to the optimum solution search unit 14.

最適解探索部14は、係数行列Cを係数行列決定部13から与えられた既知のものとして、最適な基底行列Mの探索を行う。最適解探索部14は、モンテカルロ木探索と分枝限定法による探索(以下、「分枝限定探索」という。)とを交互に繰り返し切り替えるハイブリッド探索によって、高速に最適解を求める。上述のように、実数行列Wを係数行列Cと基底行列Mに分解する問題は、式(1)に帰着できる。

Figure 2019079291
The optimal solution search unit 14 searches for the optimal basis matrix M, using the coefficient matrix C as a known one given from the coefficient matrix determination unit 13. The optimum solution search unit 14 obtains an optimum solution at high speed by a hybrid search that alternately switches between a Monte Carlo tree search and a search by branch and bound method (hereinafter referred to as “branch and bound search”) alternately. As described above, the problem of decomposing a real number matrix W into a coefficient matrix C and a basis matrix M can be reduced to equation (1).
Figure 2019079291

この式(1)において、コスト関数は、

Figure 2019079291
である。本実施の形態において一回の計算で求める基底行列Mの要素は、図2に示す基底行列Mの行ベクトルmである。 In this equation (1), the cost function is
Figure 2019079291
It is. The elements of the basis matrix M to be obtained by one calculation in the present embodiment are the row vectors m of the basis matrix M shown in FIG.

最適解探索部14は、基底行列Mの行ごとの探索を行う。行ベクトルmの場合は表記が複雑になるので、基底行列Mの各行の行ベクトルmの転置ベクトルを列ベクトルxとして、以下の説明では、以下のとおりに再定義をする。

Figure 2019079291
The optimal solution search unit 14 performs a search for each row of the basis matrix M. In the case of the row vector m, since the notation becomes complicated, the transposed vector of the row vector m of each row of the basis matrix M is redefined as the column vector x in the following description as follows.
Figure 2019079291

上記のように再定義すると、コスト関数は、

Figure 2019079291
となり、行ごとの最適解は、
Figure 2019079291
と再定義される。 Redefining as above, the cost function is
Figure 2019079291
And the optimal solution for each row is
Figure 2019079291
Redefined as

図3は、最適解探索部14で用いられる探索木を示す図である。本実施の形態では、基底行列Mは二値行列であるので、探索木として二分木が用いられる。図3は、一例として、基底数K=4の場合の二分木を示している。図3において、深さk番目のノードは、xkの値を−1にするか1にするかに該当する。二分木を最上段のルートノードから最下段のリーフノードまで辿るとx1〜xKの値が与えられて(図3の例では、x1〜x4の値が与えられて)、そのときの誤差を計算できる。   FIG. 3 is a diagram showing a search tree used in the optimum solution search unit 14. In the present embodiment, since the basis matrix M is a binary matrix, a binary tree is used as a search tree. FIG. 3 shows a binary tree in the case of the basis number K = 4 as an example. In FIG. 3, the k-th node at depth corresponds to whether the value of x k is -1 or 1. If the binary tree is traced from the root node at the top to the leaf nodes at the bottom, values of x1 to xK are given (in the example of FIG. 3, values of x1 to x4 are given), and the error at that time is calculated it can.

上述のように、最適解探索部14は、モンテカルロ木探索と分枝限定探索とを交互に繰り返し切り替えるハイブリッド探索によって最適解ベクトルを求める。すなわち、最適解探索部14は、暫定最小誤差と当該暫定最小誤差を得たときのベクトルx(暫定最適解ベクトル)、及び枝刈りの情報を引き継ぎつつモンテカルロ木探索と分枝限定探索とを交互に切り替えて、最適解ベクトルを求める。換言すると、モンテカルロ探索部141と分枝限定探索部142とは、二分木及び暫定最小誤差を共有して探索を行う。以下では、モンテカルロ探索部141におけるモンテカルロ木探索、分枝限定探索部142における分枝限定探索、及びそれらの間の切り替えについて説明する。   As described above, the optimum solution search unit 14 obtains the optimum solution vector by the hybrid search that alternately switches the Monte Carlo tree search and the branch-and-bound search alternately. That is, the optimal solution search unit 14 alternates between the Monte Carlo tree search and the branch limited search while inheriting the provisional minimum error and the vector x (provisional optimum solution vector) when the provisional minimum error is obtained, and the pruning information. Switch to and find the optimal solution vector. In other words, the Monte Carlo search unit 141 and the branch only search unit 142 share the binary tree and the provisional minimum error and perform the search. In the following, the Monte Carlo tree search in the Monte Carlo search unit 141, the branch only search in the branch only search unit 142, and switching between them will be described.

(モンテカルロ木探索)
モンテカルロ木探索部141は、探索木である二分木のルートノードからリーフノードまでの2の4乗(基底行列Mの列サイズ)とおりの経路の中から確率的に誤差が小さい経路を探索する。それぞれのノードは、スコアsと訪問回数nを値として保持している。1回の探索はルートノードから初めてリーフノードに辿り着くと終了する。
(Monte Carlo tree search)
The Monte Carlo tree search unit 141 searches for a path with a small error probability from among paths of 2 4 powers (column size of the base matrix M) from a root node of a binary tree which is a search tree to leaf nodes. Each node holds the score s and the number of visits n as values. One search ends when it reaches the leaf node for the first time from the root node.

リーフノード以外のすべてのノードは、2つの子ノードを持っている。あるノードに着目したとき、その着目ノードの両方の子ノードがまだ辿ったことのないノードである場合は、モンテカルロ木探索部141は、それらの2つの子ノードの中から、等確率でランダムに次に辿るノードを決定する。2つの子ノードのうちの一方だけ辿ったことがない場合には、モンテカルロ木探索部141は、当該辿ったことがないノードを次のノードとして決定する。   All nodes other than leaf nodes have two child nodes. When focusing on a certain node, if both child nodes of the focused node have not been traced yet, the Monte Carlo tree search unit 141 randomly selects with an equal probability from among those two child nodes. Decide which node to follow next. If only one of the two child nodes has been visited, the Monte Carlo tree search unit 141 determines the node that has not been visited as the next node.

後述する分枝限定探索によって両方の子ノードが枝刈りされている場合は、モンテカルロ木探索部141は、経路をルートノードに戻す。分枝限定探索によって一方の子ノードだけが枝刈りされている場合には、モンテカルロ木探索部141は、まだ残っている子ノードを次のノードとする。   When both child nodes are pruned by the branch and bound search described later, the Monte Carlo tree search unit 141 returns the route to the root node. When only one child node is pruned by the branch and bound search, the Monte Carlo tree search unit 141 sets the remaining child node as the next node.

両方の子ノードを辿ったことがある場合には、モンテカルロ木探索部141は、2つの子ノードのUBCスコアを比較して、その値が大きい方を次のノードとして決定する。UBCスコアは、以下の式で計算される。

Figure 2019079291
ここで、tは、それまでに探索したリーフノードの数である。 If both child nodes have been traced, the Monte Carlo tree search unit 141 compares the UBC scores of the two child nodes and determines the larger one as the next node. The UBC score is calculated by the following equation.
Figure 2019079291
Here, t is the number of leaf nodes searched so far.

モンテカルロ木探索部141は、以上の各ノードにおける子ノードの決定方法に従って、ルートノードからリーフノードまで辿り着いたときに、誤差eを計算する。モンテカルロ木探索部141は、さらに、この誤差eを以下の式に従ってリーフスコアlに変換する。

Figure 2019079291
The Monte Carlo tree searching unit 141 calculates an error e when arriving from the root node to the leaf node according to the method of determining child nodes in each of the above nodes. The Monte Carlo tree search unit 141 further converts this error e into a leaf score l according to the following equation.
Figure 2019079291

モンテカルロ木探索部141は、さらに、ルートノードから辿り着いたリーフノートまでの経路上にあるすべてのノードについて、スコアsにリーフスコアlを加算し、訪問回数nに1を加算する。そして、モンテカルロ木探索部141は、得られた誤差eと暫定最小誤差とを比較して、暫定最小誤差の方が大きければ得られた誤差eを暫定最小誤差として更新して保存する。また、モンテカルロ木探索部141は、そのときの解(即ち、当該暫定最小誤差を算出した経路x1〜xKの組み合わせからなるベクトルx)を暫定最適解ベクトルとして保存する。   Further, the Monte Carlo tree searching unit 141 adds the leaf score l to the score s and adds 1 to the number of visits n for all the nodes on the route from the root node to the leaf note reached. Then, the Monte Carlo tree searching unit 141 compares the obtained error e with the temporary minimum error, and updates and stores the obtained error e as a temporary minimum error if the temporary minimum error is larger. Further, the Monte Carlo tree search unit 141 stores the solution at that time (that is, the vector x formed of a combination of the paths x1 to xK for which the provisional minimum error is calculated) as a provisional optimal solution vector.

リーフノードで誤差eが計算されると、そのリーフノードは枝刈りされる。また、各ノードにおいて、その2つの子ノードが何れも枝刈りされている場合は、そのノード自体が枝刈りされる。   When an error e is calculated at a leaf node, that leaf node is pruned. Also, in each node, when both of its two child nodes are pruned, the node itself is pruned.

モンテカルロ木探索部141は、この探索を繰り返して、暫定最小誤差を更新する。なお、モンテカルロ木探索において、探索すべきノードがなくなった場合には探索は終了するが、一般的には、探索木のサイズは天文学的に大きいため、そのような状況にはならず、所定の条件を満たしたところで探索は打ち切られてそのときの暫定最適解が出力される。   The Monte Carlo tree search unit 141 repeats this search to update the provisional minimum error. In the Monte Carlo tree search, the search ends when there are no more nodes to be searched, but generally, the size of the search tree is astronomically large, so this situation does not occur, and a predetermined When the condition is satisfied, the search is aborted and the temporary optimal solution at that time is output.

(分枝限定探索)
分枝限定探索部142は、分枝限定法を用いて最適解を探索する。分枝限定探索部142は、ルートノードからリーフノードまでの2の4乗(基底行列Mの列サイズ)とおりの経路の中から、論理的にたどる必要のないノードを刈り取り、探索範囲を削減しながら、大域最適解を探索する。
(Branch only search)
The branch and bound search unit 142 searches for an optimal solution using a branch and bound method. The branch and bound search unit 142 prunes nodes that do not need to be logically traced out of a path according to the power of 2 4 (the column size of the base matrix M) from the root node to the leaf nodes to reduce the search range While searching for the global optimum solution.

あるノードに着目すると、分枝限定探索部142は、その着目ノードの2つの子ノードのうちの左側の子ノードがまだ枝刈りされていない場合には、左側の子ノードを次のノードとして決定する。また、分枝限定探索部142は、リーフノードまでたどり着いて誤差eを計算すると、そのリーフノードを枝刈りする。着目ノードの2つの子ノードが両方とも枝刈りされている場合は、分枝限定探索部142は、その着目ノード自体を枝刈りする。   Focusing on a certain node, the branch-boundary search unit 142 determines the left child node as the next node if the left child node of the two child nodes of the focused node has not been pruned yet Do. In addition, when the branch and bound search unit 142 reaches the leaf node and calculates the error e, it prunes the leaf node. If the two child nodes of the node of interest are both pruned, the branch-and-bound search unit 142 prunes the node of interest itself.

いま、深さkのあるノードに着目したとき、分枝限定探索部142は、ルートノードからその着目ノードまで辿った経路によって決まるx1〜xkの値を並べ、以下のとおりに部分問題を作成する。

Figure 2019079291
Now, when focusing on a node having a depth k, the branch and bound search unit 142 arranges values of x1 to xk determined by a route traced from the root node to the node of interest, and creates a partial problem as follows. .
Figure 2019079291

分枝限定探索部142は、この部分問題を下式のように、離散制約のない実数ベクトルxfを求める新たな問題として解く。

Figure 2019079291
The branch and bound search unit 142 solves this subproblem as a new problem for obtaining a real vector xf without discrete constraints as follows.
Figure 2019079291

分枝限定探索部142は、最小二乗法などを使ってこの部分問題を解くことで、最小値を求める。この最小値が暫定最小誤差よりも大きい場合には、分枝限定探索部142は、このノードを枝刈りする。これは、xfは実数ベクトルであるため、このノードより下の探索木においていかなる最適な経路を辿ってもこの最小値よりも誤差が小さい解を得ることができないためである。   The branch and bound search unit 142 finds the minimum value by solving this subproblem using a least squares method or the like. If this minimum value is larger than the provisional minimum error, the branch and bound search unit 142 prunes this node. This is because, since xf is a real vector, it is not possible to obtain a solution with a smaller error than this minimum value by tracing any optimal path in the search tree below this node.

着目したノードがリーフノードである場合は、ルートノードから当該リーフノードまでの−1と1の列が解の候補となるので、分枝限定探索部142は、ルートノードから当該リーフノードまでのxkの値を並べてベクトルを作成し、その誤差eを計算する。分枝限定探索部142は、誤差eが暫定最小誤差よりも小さい場合には、その誤差eで暫定最小誤差を更新して保存する。また、分枝限定探索部142は、そのときの解(即ち、当該暫定最小誤差を算出した経路x1〜xKの組み合わせからなるベクトルx)を暫定最適解ベクトルとして保存する。   When the focused node is a leaf node, the row of -1 and 1 from the root node to the leaf node is a candidate for a solution, so the branch and only searching unit 142 determines xk from the root node to the leaf node. Arrange the values of to create a vector and calculate its error e. If the error e is smaller than the tentative minimum error, the branch and bound search unit 142 updates and stores the tentative minimum error with the error e. In addition, the branch and bound search unit 142 stores the solution at that time (that is, the vector x formed of a combination of the paths x1 to xK for which the provisional minimum error is calculated) as a provisional optimal solution vector.

分枝限定探索部142は、すべてのノードが枝刈りされたとき、そのときの暫定最適解を大域最適解として分解誤差判定部16に出力する。   When all the nodes are pruned, the branch and bound search unit 142 outputs the temporary optimal solution at that time to the decomposition error determination unit 16 as a global optimal solution.

次に、モンテカルロ木探索部141によるモンテカルロ木探索と、分枝限定探索部142による分枝限定探索との切替について説明する。切替判定部15は、モンテカルロ木探索部141におけるモンテカルロ木探索において、リーフノードに辿り着くごとに、あるいは定期的に、モンテカルロ木探索から分枝限定探索への切替条件を満たすか否かを判定する。最適解探索部14は、切替判定部15が切替条件を満たすとの判定結果を受けたときに、モンテカルロ木探索部141による処理を終了して、分枝限定探索部142による処理を開始する。   Next, switching between the Monte Carlo tree search by the Monte Carlo tree search unit 141 and the branch only search by the branch only search unit 142 will be described. In the Monte Carlo tree search in the Monte Carlo tree search unit 141, the switching determination unit 15 determines whether or not the switching condition from the Monte Carlo tree search to the branch-limited search is satisfied each time the leaf node is reached or periodically. . When the switching solution determination unit 15 receives the determination result that the switching determination unit 15 satisfies the switching condition, the optimum solution searching unit 14 ends the process by the Monte Carlo tree searching unit 141 and starts the process by the branch and limitation searching unit 142.

切替判定部15は、分枝限定探索部142における分枝限定探索において、リーフノードに辿り着くごとに、あるいは定期的に、分枝限定探索からモンテカルロ木探索への切替条件を満たすか否かを判定する。最適解探索部14は、切替判定部15が切替条件を満たすとの判定結果を受けたときに、分枝限定探索部142による処理を終了して、モンテカルロ木探索部141による処理を開始する。また、上述のように、分枝限定探索部142は、すべてのノードが枝刈りされたときに、そのときの暫定最適解ベクトル(大域最適解ベクトル)を基底行列更新部16に出力する。   The switching determination unit 15 determines whether or not the switching condition from the branch only search to the Monte Carlo tree search is satisfied every time the branch node reaches the leaf node or periodically in the branch only search in the branch only search unit 142. judge. When the switching solution determination unit 15 receives the determination result that the switching determination unit 15 satisfies the switching condition, the optimum solution searching unit 14 ends the process by the branch and limitation searching unit 142 and starts the process by the Monte Carlo tree searching unit 141. Further, as described above, when all the nodes are pruned, the branch and bound search unit 142 outputs the temporary optimal solution vector (global optimal solution vector) at that time to the basis matrix update unit 16.

切替判定部15におけるモンテカルロ木探索から分枝限定探索への切替条件と、分枝限定探索からモンテカルロ木探索への切替条件とは、同じであってよく、異なっていてもよい。切替判定部15における切替条件の第1の例は、暫定最小誤差の更新が滞ることである。具体的には、切替判定部15は、誤差を所定回数計算する(即ち、リーフノードまで所定回数辿り着く)間に、暫定最小誤差が所定回数(1回でもよい)以上更新されなかった場合に、暫定最小誤差の更新が滞ったとして、切替条件を満たすと判定する。   The switching condition from the Monte Carlo tree search to the branch limited search in the switching determination unit 15 and the switching condition from the branch limited search to the Monte Carlo tree search may be the same or different. A first example of the switching condition in the switching determination unit 15 is that updating of the temporary minimum error is delayed. Specifically, when the switching determination unit 15 calculates an error a predetermined number of times (that is, the leaf node is reached a predetermined number of times), the temporary minimum error is not updated more than the predetermined number of times (may be one). It is determined that the switching condition is satisfied, assuming that the update of the temporary minimum error is delayed.

切替条件の第2の例は、前の切替えからから所定時間が経過したことである。この例では、切替判定部15は、モンテカルロ木探索から分枝限定探索に切り替えてから所定時間を経過したときに、切替条件を満たすと判断して、分枝限定探索からモンテカルロ木探索に切り替え、分枝限定探索からモンテカルロ木探索に切り替えてから所定時間を経過したときに、切替条件を満たすと判断して、分枝限定法からモンテカルロ木探索に切り替える。   A second example of the switching condition is that a predetermined time has elapsed since the previous switching. In this example, the switching determination unit 15 determines that the switching condition is satisfied when a predetermined time has elapsed after switching from Monte Carlo tree search to branch limited search, and switches from branch limited search to Monte Carlo tree search. When a predetermined time passes after switching from the branch-limited search to the Monte Carlo tree search, it is determined that the switching condition is satisfied, and the branch-and-bound method is switched to the Monte Carlo tree search.

切替条件の第3の例は、誤差を所定回数算出した(即ち、リーフノードまで所定回数辿り着いた)ことである。切替条件の第4の例は、前の切り替えから所定時間が経過するか(第2の例)、誤差を所定回数以上計算するか(第3の例)のいずれかを満足することである。   A third example of the switching condition is that the error has been calculated a predetermined number of times (that is, the leaf node has reached a predetermined number of times). A fourth example of the switching condition is to satisfy either the predetermined time elapses from the previous switching (second example) or the error is calculated a predetermined number of times or more (third example).

また、切替判定部15は、ランダムに切替判定をしてもよい。この場合に、切り替える確率は任意に決定してよい。また、切替判定部15は、誤差を所定回数算出した後に、ランダムに切り替えを判定してよい。   Further, the switching determination unit 15 may randomly perform switching determination. In this case, the switching probability may be determined arbitrarily. The switching determination unit 15 may randomly determine switching after calculating the error a predetermined number of times.

ベクトル抽出部12、最適解探索部14、及び切替判定部15は、上記の処理を実数行列Wのすべての行ベクトルw1〜wDについて行う。その結果、分解誤差判定部16は、D個の行ベクトルw1〜wDに対応するD個の大域最適解m1〜mDを取得する。   The vector extraction unit 12, the optimal solution search unit 14, and the switching determination unit 15 perform the above-described process on all the row vectors w 1 to w D of the real number matrix W. As a result, the decomposition error determination unit 16 obtains D global optimum solutions m1 to mD corresponding to the D row vectors w1 to wD.

分解誤差判定部16は、大域最適解m1〜mDを順に並べることで基底行列Mを生成し、この基底行列Mとそれを求めた係数行列Cとを用いて、実数行列Wと、基底行列Mと係数行列Cとの積との差分を分解誤差Eとして求める。分解誤差判定部16は、分解誤差Eが暫定最小分解誤差より小さいか否かを判断し、分解誤差Eが、暫定最小分解誤差より小さい場合には、当該分解誤差Eで暫定最小分解誤差を更新し、当該分解誤差Eを与えた基底行列M及び係数行列Cを保存する。   The decomposition error determination unit 16 generates the basis matrix M by arranging the global optimum solutions m1 to mD in order, and using the basis matrix M and the coefficient matrix C for which it is calculated, the real number matrix W and the basis matrix M The difference between the product of and the coefficient matrix C is determined as a decomposition error E. The decomposition error judgment unit 16 judges whether the decomposition error E is smaller than the provisional minimum decomposition error, and updates the provisional minimum decomposition error with the decomposition error E if the decomposition error E is smaller than the provisional minimum decomposition error. Then, the basis matrix M and the coefficient matrix C given the decomposition error E are stored.

分解誤差判定部16は、大域最適解m1〜mDを順に並べることで生成した基底行列Mを係数行列決定部13に出力する。係数行列決定部13は、実数行列Wと基底行列Mとに基づいて、最小二乗法により係数行列Cを決定(更新)する。なお、係数行列決定部13は、まだ最適解探索部14における処理が行われていない処理の最初には、基底行列Mが得られていないため、係数行列Cを乱数で決定(初期化)して最適解探索部14に与える。   The decomposition error determination unit 16 outputs a basis matrix M generated by arranging the global optimum solutions m1 to mD in order to the coefficient matrix determination unit 13. The coefficient matrix determination unit 13 determines (updates) the coefficient matrix C by the least squares method based on the real number matrix W and the basis matrix M. Note that the coefficient matrix determination unit 13 determines (initializes) the coefficient matrix C with random numbers since the basis matrix M is not obtained at the beginning of the process in which the process in the optimum solution search unit 14 is not yet performed. To the optimum solution search unit 14.

分解行列出力部17は、分解誤差判定部16における暫定最小分解誤差が十分に小さくなった場合には、その暫定最小分解誤差を与えた基底行列M及び係数行列Cを行列分解の結果として出力する。分解行列出力部17は、例えば、暫定最小分解誤差が所定の閾値以下となった場合に、暫定最小分解誤差が十分に小さくなったと判断してよく、暫定最小分解誤差が更新されなくなったときに、暫定最小分解誤差が十分に小さくなったと判断してもよく、最適解探索部14において所定回数のハイブリッド探索を実行したとき(即ち、所定回数の係数行列Cの更新を行ったとき)に暫定最小分解誤差が十分に小さくなったと判断してもよい。   When the provisional minimum decomposition error in the decomposition error determination unit 16 becomes sufficiently small, the decomposition matrix output unit 17 outputs the basis matrix M and the coefficient matrix C given the provisional minimum decomposition error as a result of matrix decomposition. . For example, when the provisional minimum decomposition error becomes equal to or less than a predetermined threshold, the decomposition matrix output unit 17 may determine that the provisional minimum decomposition error has become sufficiently small, and the provisional minimum decomposition error is not updated. It may be determined that the provisional minimum decomposition error has become sufficiently small, and the optimal solution search unit 14 executes the hybrid search a predetermined number of times (that is, when the coefficient matrix C is updated a predetermined number of times). It may be determined that the minimum resolution error has become sufficiently small.

図4は、本実施の形態の行列分解装置にて実行される行列分解方法のフロー図である。行列分解装置10は、まず、実数行列入力部11にて、外部から実数行列Wを入力する(ステップS11)。また、係数行列決定部13は、乱数を用いて係数行列Cをランダムに初期化する(ステップS12)。ベクトル抽出部12及び最適解探索部14は、i=1として(ステップS13)、列ベクトルbについての最適解ベクトルxを探索する(ステップS14)。   FIG. 4 is a flowchart of the matrix factorization method executed by the matrix factorization device of the present embodiment. The matrix factorization apparatus 10 first inputs the real number matrix W from the outside at the real number matrix input unit 11 (step S11). In addition, the coefficient matrix determination unit 13 randomly initializes the coefficient matrix C using random numbers (step S12). The vector extraction unit 12 and the optimum solution search unit 14 set i = 1 (step S13), and search for the optimum solution vector x for the column vector b (step S14).

列ベクトルbについて最適解ベクトルxを取得すると、ベクトル抽出部12及び最適解探索部14は、i=Dであるか、即ち、実数行列Wのすべての列ベクトルbについて最適解ベクトルxを求めたかを判定する(ステップS15)。   When obtaining the optimum solution vector x for the column vector b, the vector extraction unit 12 and the optimum solution search unit 14 determine whether i = D, that is, obtain the optimum solution vector x for all column vectors b of the real matrix W Is determined (step S15).

まだ最適解ベクトルxを求めていない列ベクトルbがある場合には(ステップS15にてNO)、iをインクリメントして(ステップS16)、ステップS14に戻って、次の列ベクトルbについて最適解ベクトルxを探索する(ステップS14)。実数行列Wのすべての列ベクトルbについて最適解ベクトルxが求まると(ステップS15にてYES)、分解誤差判定部16は、それらの最適解ベクトルxを用いて基底行列Mを生成して、そのときの係数行列Cを用いて分解誤差Eを計算する(ステップS17)。   If there is a column vector b for which the optimal solution vector x has not yet been obtained (NO in step S15), i is incremented (step S16), and the process returns to step S14 and the optimal solution vector for the next column vector b Search x (step S14). When optimal solution vectors x are obtained for all column vectors b of real number matrix W (YES in step S15), decomposition error determination unit 16 generates basis matrix M using those optimal solution vectors x, and The decomposition error E is calculated using the coefficient matrix C at that time (step S17).

分解誤差判定部16は、算出した分解誤差Eが暫定最小分解誤差よりも小さいか否かによって暫定最小分解誤差を更新するか否かを判断する(ステップS18)。分解誤差判定部16は、算出した分解誤差Eが暫定最小分解誤差よりも小さい場合には(ステップS18にてYES)、分解誤差Eで暫定最小分解誤差を更新し(ステップS19)、算出した分解誤差Eが暫定最小分解誤差よりも大きい場合には(ステップS18にてNO)、分解誤差Eで暫定最小誤差を更新することなく、分解を終了するか否かを判断する(ステップS20)。分解終了の判断は、上述のように、暫定最小分解誤差が十分に小さくなったか否かによる。   The decomposition error determination unit 16 determines whether to update the provisional minimum decomposition error based on whether the calculated decomposition error E is smaller than the provisional minimum decomposition error (step S18). When the calculated decomposition error E is smaller than the provisional minimum decomposition error (YES in step S18), the decomposition error determination unit 16 updates the provisional minimum decomposition error with the decomposition error E (step S19), and the calculated decomposition If the error E is larger than the provisional minimum decomposition error (NO in step S18), it is determined whether the decomposition is ended without updating the provisional minimum error with the decomposition error E (step S20). The determination of the end of decomposition depends on whether or not the provisional minimum decomposition error has become sufficiently small, as described above.

分解を終了しない場合には(ステップS20にてNO)、係数行列決定部13は、生成した基底行列Mと入力されている実数行列Wを用いて係数行列Cを更新し、ステップS13に戻って再度行列の分解を行う。   When the decomposition is not completed (NO in step S20), coefficient matrix determination unit 13 updates coefficient matrix C using generated basic matrix M and input real number matrix W, and returns to step S13. Perform matrix decomposition again.

分解誤差判定部16が分解を終了すると判断した場合には(ステップS20にてYES)、行列出力部17は、そのときの暫定最小分解誤差を得た基底行列M及び係数行列Cを分解結果として出力する(ステップS21)。   When it is determined that the decomposition error determination unit 16 ends the decomposition (YES in step S20), the matrix output unit 17 uses the base matrix M and the coefficient matrix C from which the provisional minimum decomposition error is obtained as the decomposition result. It outputs (step S21).

図5は、ベクトル抽出部12及び最適解探索部14による、最適解ベクトルxの探索処理(ステップS14)のサブルーチンのフロー図である。ベクトル抽出部12は、まず、入力されている実数行列Wの第i行の行ベクトルの転置ベクトルを列ベクトルbとして抽出する(ステップS41)。モンテカルロ木探索部141は、列ベクトルbと係数行列Cを用いてモンテカルロ木探索を実行する(ステップS42)。   FIG. 5 is a flowchart of a subroutine of search processing (step S14) for the optimum solution vector x by the vector extraction unit 12 and the optimum solution search unit 14. The vector extraction unit 12 first extracts the transposed vector of the row vector of the ith row of the input real number matrix W as a column vector b (step S41). The Monte Carlo tree search unit 141 executes a Monte Carlo tree search using the column vector b and the coefficient matrix C (Step S42).

切替判定部15は、切替条件を充足するか否かを判定し(ステップS43)、切替条件を充足していなければ(ステップS43でNO)、モンテカルロ木探索部141は、モンテカルロ木探索を継続する(ステップS42)。切替判定部15が切替条件を充足すると判定した場合は(ステップS43にてYES)、最適解探索部14は、そのときの二分木、暫定最小誤差及び暫定最適解ベクトルを引き継いで、モンテカルロ木探索から分枝限定探索部142による分枝限定探索に切り替え、分枝限定探索部142は分枝限定探索を実行する(ステップS44)。   The switch determination unit 15 determines whether the switch condition is satisfied (step S43), and if the switch condition is not satisfied (NO in step S43), the Monte Carlo tree search unit 141 continues the Monte Carlo tree search. (Step S42). When the switching determination unit 15 determines that the switching condition is satisfied (YES in step S43), the optimum solution searching unit 14 inherits the binary tree at that time, the provisional minimum error, and the provisional optimum solution vector, and searches the Monte Carlo tree. Is switched to the branch only search by the branch only search unit 142, and the branch only search unit 142 executes the branch only search (step S44).

切替判定部15は、切替条件を充足するか否かを判定し(ステップS45)、切替条件を充足していなければ(ステップS45にてNO)、分枝限定探索部142は、分枝限定探索を継続する(ステップS44)。切替判定部15が切替条件を充足すると判定した場合は(ステップS45にてYES)、最適解探索部14は、分枝限定探索部142にて大域最適解が得られているか(枝刈りされていないすべてのノードを辿ったか)否かを判断する(ステップS46)。   The switching determination unit 15 determines whether or not the switching condition is satisfied (step S45), and if the switching condition is not satisfied (NO in step S45), the branch limitation search unit 142 performs branch limitation search (Step S44). If the switching determination unit 15 determines that the switching condition is satisfied (YES in step S45), the optimum solution searching unit 14 determines whether the global optimum solution is obtained by the branch and only searching unit 142 (pruned) It is determined whether all the nodes that have not been traced) (step S46).

最適解探索部14は、まだ大域最適解が得られていない場合には(ステップS46にてNO)、そのときの二分木、暫定最小誤差及び暫定最適解ベクトルを引き継いで、分枝限定法からモンテカルロ木探索部141によるモンテカルロ木探索に切り替え、モンテカルロ木探索部141は、モンテカルロ木探索を実行する(ステップS42)。   If the global optimum solution has not been obtained yet (NO at step S46), the optimum solution search unit 14 inherits the binary tree at that time, the provisional minimum error and the provisional optimum solution vector, and Switching to the Monte Carlo tree search by the Monte Carlo tree search unit 141, the Monte Carlo tree search unit 141 executes the Monte Carlo tree search (step S42).

このように、最適解探索部14は、分枝限定探索部142における分枝限定探索によって大域最適解が得られるまで、モンテカルロ木探索と分枝限定探索を交互に繰り返して行う。そして、最適解探索部14は、大域最適解が取得できたら(ステップS46にてYES)、図4のフローに戻る。   Thus, the optimal solution search unit 14 alternately repeats the Monte Carlo tree search and the branch-limited search until the global optimum solution is obtained by the branch-limited search in the branch-limited search unit 142. Then, when the global optimum solution is obtained (YES in step S46), the optimum solution search unit 14 returns to the flow of FIG.

以上説明したように、本実施の形態の行列分解装置10は、実数行列Wを離散値からなる基底行列Mと実数からなる係数行列Cとの積に分解するにあたって、まず、係数行列Cを固定して基底行列Mを更新し、基底行列Mが更新されたらそれに従って係数行列Cを更新して、分解誤差が十分に小さくなるまで基底行列Mの更新と係数行列Cの更新を繰り返す。   As described above, the matrix factorization device 10 according to the present embodiment first fixes the coefficient matrix C in order to decompose the real number matrix W into the product of the basis matrix M consisting of discrete values and the coefficient matrix C consisting of real numbers. Then, the base matrix M is updated, and when the base matrix M is updated, the coefficient matrix C is updated accordingly, and the update of the base matrix M and the update of the coefficient matrix C are repeated until the decomposition error becomes sufficiently small.

そして、本実施の形態の行列分解装置10は、係数行列Cを固定して基底行列Mを更新する際には、行ごとに、モンテカルロ木探索と分枝限定探索とを交互に繰り返すハイブリッド探索を行う。このハイブリッド探索では、モンテカルロ木探索によって、短時間に比較的良い解が得られるので、分枝限定探索によって早期に厳密な大域最適解を見つけることができる。すなわち、本実施の形態の行列分解装置10によれば、行列分解の速度と精度を向上できる。   Then, when updating the basis matrix M by fixing the coefficient matrix C and fixing the coefficient matrix C, the matrix factorization device 10 of this embodiment performs a hybrid search that alternately repeats the Monte Carlo tree search and the branch-and-bound search for each row. Do. In this hybrid search, since a Monte Carlo tree search can provide a relatively good solution in a short time, a branch-and-bound search can quickly find a strictly global optimum solution. That is, according to the matrix factorization device 10 of the present embodiment, the speed and accuracy of matrix factorization can be improved.

なお、図5の例では、最適解探索部14は、分枝限定法によって得られる大域最適解ベクトルを列ベクトルbに対する最適解ベクトルとして出力した。すなわち、最適解探索部14は、大域最適解が得られるまでモンテカルロ木探索と分枝限定探索とのハイブリッド探索を行ったが、大域最適解が得られる前にハイブリッド探索を打ち切ってもよい。例えば、モンテカルロ木探索(ステップS42)と分枝限定法(ステップS44)との切替えを所定回数行った場合に、そのときの暫定最小誤差を与える解を最適解ベクトルとして出力してハイブリッド探索を終了してよく、又は、暫定最小誤差が所定の閾値を下回ったときに、暫定最小誤差を与える解を最適解ベクトルとして出力してハイブリッド探索を終了してよい。   In the example of FIG. 5, the optimal solution search unit 14 outputs the global optimal solution vector obtained by the branch and bound method as the optimal solution vector for the column vector b. That is, although the optimum solution search unit 14 performs the hybrid search of the Monte Carlo tree search and the branch-and-bound search until the global optimum solution is obtained, the hybrid search may be aborted before the global optimum solution is obtained. For example, when switching between the Monte Carlo tree search (step S42) and the branch and bound method (step S44) is performed a predetermined number of times, the solution giving the temporary minimum error at that time is output as the optimum solution vector and the hybrid search is ended. Alternatively, when the provisional minimum error falls below a predetermined threshold, a solution giving the provisional minimum error may be output as an optimal solution vector to end the hybrid search.

本発明は、演算負荷を軽減して効率的に最適解を見つけることができ、実数行列を離散値からなる基底行列と実数からなる係数行列との積に分解する行列分解装置等として有用である。   The present invention can reduce the operation load and efficiently find the optimum solution, and is useful as a matrix factorization device that decomposes a real number matrix into a product of a basis matrix consisting of discrete values and a coefficient matrix consisting of real numbers. .

10 行列分解装置
11 実数行列入力部
12 ベクトル抽出部
13 係数行列決定部
14 最適解探索部
141 モンテカルロ木探索部
142 分枝限定探索部
15 切替判定部
16 分解誤差判定部
17 分解行列出力部
DESCRIPTION OF SYMBOLS 10 matrix decomposition apparatus 11 real number matrix input part 12 vector extraction part 13 coefficient matrix determination part 14 optimal solution search part 141 Monte Carlo tree search part 142 branch limited search part 15 switch determination part 16 decomposition error determination part 17 decomposition matrix output part

Claims (8)

実数行列(W)を離散値からなる基底行列(M)と実数からなる係数行列(C)との積に分解する行列分解装置(10)であって、
実数行列(W)の各行の実数ベクトル(b)を抽出するベクトル抽出部(12)と、
係数行列(C)を決定する係数行列決定部(13)と、
前記係数行列決定部(13)にて決定された前記係数行列(C)を用いて、前記ベクトル抽出部(12)にて抽出された各行の前記実数ベクトル(b)に対応する基底行列(M)の各行の最適解ベクトル(m)を求める最適解探索部(14)と、
前記最適解探索部(14)で求められた各行の前記最適解ベクトル(m)を組み合わせて前記基底行列(M)として出力するとともに、当該基底行列(M)を得た際に用いた前記係数行列(C)を出力する分解行列出力部(17)と、
を備え、
前記最適解探索部(14)は、探索木及び暫定最小誤差を引き継ぎつつモンテカルロ木探索と分枝限定探索とを交互に繰り返し切り替えるハイブリッド探索を行う、行列分解装置(10)。
A matrix factorization apparatus (10) which decomposes a real number matrix (W) into a product of a basis matrix (M) of discrete values and a coefficient matrix (C) of real numbers,
A vector extraction unit (12) for extracting a real vector (b) of each row of the real matrix (W);
A coefficient matrix determination unit (13) that determines a coefficient matrix (C);
A base matrix (M corresponding to the real vector (b) of each row extracted by the vector extraction unit (12) using the coefficient matrix (C) determined by the coefficient matrix determination unit (13) An optimal solution search unit (14) for determining an optimal solution vector (m) of each row of
The coefficients used when the optimal solution vector (m) of each row determined by the optimal solution search unit (14) is combined and output as the basis matrix (M), and the basis matrix (M) is obtained A decomposition matrix output unit (17) that outputs a matrix (C);
Equipped with
The optimal solution search unit (14) is a matrix decomposition apparatus (10) that performs a hybrid search that alternately switches between Monte Carlo tree search and branch-and-bound search while taking over the search tree and the temporary minimum error.
前記最適解探索部(14)で求められた各行の前記最適解ベクトル(m)を組み合わせて前記基底行列(M)としたときの前記分解誤差(E)が、所定の基準に基づいて十分に小さくなったか否かを判定する分解誤差判定部(16)をさらに備え、
前記分解行列出力部(17)は、前記分解誤差判定部(16)にて前記分解誤差(E)が十分に小さくなったと判定されたときに、前記基底行列(M)及び前記係数行列(C)を出力し、
前記分解誤差判定部(16)にて分解誤差(E)が十分に小さくなっていないと判定されたときに、前記係数行列決定部(13)は、新たな前記係数行列(C)を決定し、前記最適解探索部(14)は、新たな前記係数行列(C)を用いて新たな最適解ベクトルを求める、請求項1に記載の行列分解装置(10)。
The decomposition error (E) when the optimal solution vector (m) of each row determined by the optimal solution search unit (14) is combined to form the base matrix (M) is sufficiently based on a predetermined criterion. The apparatus further comprises a decomposition error determination unit (16) that determines whether or not it has become smaller
The decomposition matrix output unit (17) is configured to determine the basis matrix (M) and the coefficient matrix (C) when the decomposition error determination unit (16) determines that the decomposition error (E) has become sufficiently small. Output),
The coefficient matrix determination unit (13) determines a new coefficient matrix (C) when the decomposition error determination unit (16) determines that the decomposition error (E) is not sufficiently small. The matrix decomposition apparatus (10) according to claim 1, wherein the optimum solution search unit (14) obtains a new optimum solution vector using the new coefficient matrix (C).
前記最適解探索部(14)は、前記分枝限定探索にて大域最適解ベクトルが得られるまで前記ハイブリッド探索を行い、前記大域最適解ベクトルを前記最適解ベクトルとして求める、請求項1又は2に記載の行列分解装置(10)。   The optimal solution search unit (14) performs the hybrid search until a global optimal solution vector is obtained in the branch-and-bound search, and obtains the global optimal solution vector as the optimal solution vector. The matrix factorization device (10) as described. 前記最適解探索部(14)は、前記暫定最小誤差の更新が滞ったときに、前記モンテカルロ木探索と前記分枝限定探索とを切り替える、請求項1〜3のいずれかに記載の行列分解装置(10)。   The matrix decomposition apparatus according to any one of claims 1 to 3, wherein the optimum solution search unit (14) switches between the Monte Carlo tree search and the branch-and-bound search when updating of the temporary minimum error is delayed. (10). 前記最適解探索部(14)は、前の切替えから所定時間が経過したときに、前記モンテカルロ木探索と前記分枝限定探索とを切り替える、請求項1〜3のいずれかに記載の行列分解装置(10)。   The matrix decomposition apparatus according to any one of claims 1 to 3, wherein the optimal solution search unit (14) switches between the Monte Carlo tree search and the branch-and-bound search when a predetermined time has elapsed since the previous switching. (10). 前記最適解探索部(14)は、誤差を所定回数算出したときに、前記モンテカルロ木探索と前記分枝限定探索とを切り替える、請求項1〜3のいずれかに記載の行列分解装置(10)。   The matrix decomposition apparatus (10) according to any one of claims 1 to 3, wherein the optimal solution search unit (14) switches between the Monte Carlo tree search and the branch-and-bound search when an error is calculated a predetermined number of times. . 前記最適解探索部(14)は、前の切替えから所定時間が経過し、又は誤差を所定回数算出したときに、前記モンテカルロ木探索法と前記分枝限定探索とを切り替える、請求項1〜3のいずれかに記載の行列分解装置(10)。   The optimal solution search unit (14) switches between the Monte Carlo tree search method and the branch-limited search when a predetermined time has elapsed since the previous switching or when an error is calculated a predetermined number of times. The matrix factorization device (10) according to any one of the above. 実数行列(W)を離散値からなる基底行列(M)と実数からなる係数行列(C)との積に分解する行列分解方法であって、
実数行列(W)を取得するステップと、
前記実数行列(W)の各行の実数ベクトル(b)を抽出するステップと、
係数行列(C)を決定するステップと、
前記実数ベクトル(b)と前記係数行列(C)とを用いて、各行の前記実数ベクトル(b)に対する基底行列(M)の各行の最適解ベクトル(m)を求めるステップと、
前記実数行列(W)から抽出されたすべての前記実数ベクトル(b)について求めた前記最適解ベクトル(m)を組み合わせて前記基底行列(M)として出力し、当該基底行列(M)を得た際に用いた前記係数行列(C)を出力するステップと、
を含み、
前記最適解ベクトル(m)を求めるステップは、探索木及び暫定最小誤差を引き継ぎつつモンテカルロ木探索と分枝限定探索とを交互に繰り返し切り替えるハイブリッド探索を行う、行列分解方法。
A matrix decomposition method for decomposing a real matrix (W) into a product of a basis matrix (M) of discrete values and a coefficient matrix (C) of real numbers,
Obtaining a real matrix (W);
Extracting a real vector (b) of each row of the real matrix (W);
Determining a coefficient matrix (C);
Determining an optimal solution vector (m) of each row of the basis matrix (M) for the real vector (b) of each row using the real vector (b) and the coefficient matrix (C);
The optimal solution vectors (m) determined for all the real vectors (b) extracted from the real matrix (W) are combined and output as the basis matrix (M) to obtain the basis matrix (M) Outputting the coefficient matrix (C) used in
Including
The step of obtaining the optimum solution vector (m) is a matrix decomposition method in which a hybrid search in which a Monte Carlo tree search and a branch-and-bound search are alternately switched repeatedly while taking over a search tree and a provisional minimum error is performed.
JP2017205934A 2017-10-25 2017-10-25 Matrix factorization device and matrix factorization method Active JP6889087B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017205934A JP6889087B2 (en) 2017-10-25 2017-10-25 Matrix factorization device and matrix factorization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017205934A JP6889087B2 (en) 2017-10-25 2017-10-25 Matrix factorization device and matrix factorization method

Publications (2)

Publication Number Publication Date
JP2019079291A true JP2019079291A (en) 2019-05-23
JP6889087B2 JP6889087B2 (en) 2021-06-18

Family

ID=66627798

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017205934A Active JP6889087B2 (en) 2017-10-25 2017-10-25 Matrix factorization device and matrix factorization method

Country Status (1)

Country Link
JP (1) JP6889087B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113159272A (en) * 2020-01-07 2021-07-23 阿里巴巴集团控股有限公司 Method and system for processing neural network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07319848A (en) * 1994-05-27 1995-12-08 Fujitsu Ltd System and method for retrieving optimum solution
JP2010186425A (en) * 2009-02-13 2010-08-26 Mitsubishi Electric Corp Method and apparatus for data processing of finding combinatorial optimum solution
JP2016042359A (en) * 2014-08-18 2016-03-31 株式会社デンソーアイティーラボラトリ Recognition apparatus, real number matrix decomposition method, and recognition method
JPWO2014115232A1 (en) * 2013-01-25 2017-01-19 日本電気株式会社 Solution search device, solution search method, and solution search program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07319848A (en) * 1994-05-27 1995-12-08 Fujitsu Ltd System and method for retrieving optimum solution
JP2010186425A (en) * 2009-02-13 2010-08-26 Mitsubishi Electric Corp Method and apparatus for data processing of finding combinatorial optimum solution
JPWO2014115232A1 (en) * 2013-01-25 2017-01-19 日本電気株式会社 Solution search device, solution search method, and solution search program
JP2016042359A (en) * 2014-08-18 2016-03-31 株式会社デンソーアイティーラボラトリ Recognition apparatus, real number matrix decomposition method, and recognition method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113159272A (en) * 2020-01-07 2021-07-23 阿里巴巴集团控股有限公司 Method and system for processing neural network

Also Published As

Publication number Publication date
JP6889087B2 (en) 2021-06-18

Similar Documents

Publication Publication Date Title
Ahmed et al. A novel decision tree classification based on post-pruning with Bayes minimum risk
Faerman et al. Lasagne: Locality and structure aware graph node embedding
Trinh et al. A novel constrained genetic algorithm-based Boolean network inference method from steady-state gene expression data
JP6325762B1 (en) Information processing apparatus, information processing method, and information processing program
JP2019079291A (en) Matrix decomposition device and matrix decomposition method
de Campos et al. Stochastic local and distributed search algorithms for learning belief networks
JP5964781B2 (en) SEARCH DEVICE, SEARCH METHOD, AND SEARCH PROGRAM
Medland et al. Improving the c Ant-Miner PB Classification Algorithm
JP6867929B2 (en) Matrix factorization device and matrix factorization method
Ma et al. Exploiting bias for cooperative planning in multi-agent tree search
Liu et al. Analysis and prediction of trajectories using bayesian network
JP5126694B2 (en) Learning system
US20220230712A1 (en) Systems and methods for template-free reaction predictions
Challita et al. New technique for feature selection: Combination between elastic net and relief
US20210081488A1 (en) Information processing apparatus, storage medium and information processing method
Gupta et al. Randomized bias genetic algorithm to solve traveling salesman problem
Llerena et al. Robust analysis of map inference in selective sum-product networks
Bidlo et al. Evolutionary development of growing generic sorting networks by means of rewriting systems
Jasser et al. Ant Colony Optimization (ACO) and a Variation of Bee Colony Optimization (BCO) in Solving TSP Problem: A Comparative Study
Paul et al. Robust incremental logistic regression for detection of anomaly using big data
CN111064603B (en) Network link determining method, device and equipment
JP2014142849A (en) Solution search device, solution search method and solution search program
KR20190040864A (en) Apparatus and method for representation learning in signed directed networks
JP2012068776A (en) Optimization device, optimization method and optimization program
JP6634000B2 (en) Graph structure estimation device, graph structure estimation method, and graph structure estimation program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200225

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210215

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210309

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210428

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20210518

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210520

R150 Certificate of patent or registration of utility model

Ref document number: 6889087

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250