[go: up one dir, main page]

CN110222239B - A structure-variable pattern generation and a method for generating a browsing interface using patterns - Google Patents

A structure-variable pattern generation and a method for generating a browsing interface using patterns Download PDF

Info

Publication number
CN110222239B
CN110222239B CN201910425318.7A CN201910425318A CN110222239B CN 110222239 B CN110222239 B CN 110222239B CN 201910425318 A CN201910425318 A CN 201910425318A CN 110222239 B CN110222239 B CN 110222239B
Authority
CN
China
Prior art keywords
pattern
relationship
elements
vector
value
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.)
Expired - Fee Related
Application number
CN201910425318.7A
Other languages
Chinese (zh)
Other versions
CN110222239A (en
Inventor
曾嘉晟
聂勇伟
李桂清
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.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
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 South China University of Technology SCUT filed Critical South China University of Technology SCUT
Priority to CN201910425318.7A priority Critical patent/CN110222239B/en
Publication of CN110222239A publication Critical patent/CN110222239A/en
Application granted granted Critical
Publication of CN110222239B publication Critical patent/CN110222239B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Complex Calculations (AREA)

Abstract

本发明公开了一种结构可变的图案生成和利用图案生成浏览界面的方法,所述图案生成方法,包括以下步骤:S1、为图案中的元素构建关系图模型;S2、采用能量方程的离散优化模型,在不同拓扑结构图案之间进行元素的匹配;S3、基于RJMCMC算法,在不同拓扑结构图案之间采样,获得新的图案。所述利用图案生成浏览界面的方法,包括以下步骤:1)、获取采样得到的新图案的高维向量表达特征,得到高维向量空间;所述高位向量表达特征采用该图案的关系图向量表示;2)、采用GPLVM将高维向量空间压缩到二维流形空间;3)、将二维流形空间中的点逆映射到高维空间中,得到新的图案,并对其进行后处理;4)、生成图案浏览界面。

Figure 201910425318

The invention discloses a method for generating a structure-variable pattern and using the pattern to generate a browsing interface. The pattern generating method includes the following steps: S1, constructing a relational graph model for the elements in the pattern; S2, adopting a discrete energy equation Optimize the model and match elements between different topological patterns; S3, based on the RJMCMC algorithm, sample between different topological patterns to obtain new patterns. The method for generating a browsing interface by using a pattern includes the following steps: 1) Acquiring the high-dimensional vector expression features of the new pattern obtained by sampling to obtain a high-dimensional vector space; the high-level vector expression features are expressed by the vector representation of the pattern ; 2), use GPLVM to compress the high-dimensional vector space into a two-dimensional manifold space; 3), inversely map the points in the two-dimensional manifold space to the high-dimensional space, obtain a new pattern, and perform post-processing on it ; 4), generating a pattern browsing interface.

Figure 201910425318

Description

一种结构可变的图案生成和利用图案生成浏览界面的方法A structure-variable pattern generation and a method for generating a browsing interface using patterns

技术领域technical field

本发明涉及计算机图案生成和图案浏览领域,尤其是涉及一种结构可变的图案生成和利用图案生成浏览界面的方法。The invention relates to the fields of computer pattern generation and pattern browsing, in particular to a method for pattern generation with variable structure and a browsing interface generated by using patterns.

背景技术Background technique

现有的成熟的算法和系统能够简单快速地根据单一图案的形态结构获得很多拥有不同元素大小,位置,方向的变体候选。例如论文PATEX:exploring pattern variations中,作者使用图案部件之间的几何关系来描述图案并通过采样那些分别满足不同几何关系的子集的图案来获得许多基于源图案的图案变体。然而此种方法仅针对于单一图案变体,无法在多个图案之间自动化地创作出一些既能保持一些不同源图案中的特征也能带来一些新变化的图案。Existing mature algorithms and systems can simply and quickly obtain many variant candidates with different element sizes, positions, and directions based on the morphological structure of a single pattern. For example, in the paper PATEX:exploring pattern variations, the author uses the geometric relationship between the pattern parts to describe the pattern and obtains many pattern variants based on the source pattern by sampling those patterns that satisfy a subset of different geometric relations. However, this method is only aimed at a single pattern variation, and cannot automatically create patterns among multiple patterns that can maintain some characteristics of different source patterns and bring some new changes.

另外对于不同的图案来说,它们之间的元素和排列特征都可能大相径庭。在两个简单的图案之间也会存在无数的图案变体。这样具有差异的新图案结果需要尽可能多地被采样到。最后,目前的图案设计工具中缺少一些能够让设计师在同一个集合内快速连续地浏览到所有的这些元素和形态结构各不相同的图案变体。In addition, for different patterns, the elements and arrangement characteristics between them may be quite different. There are also countless pattern variations between two simple patterns. Such different new pattern results need to be sampled as much as possible. Finally, current pattern design tools lack patterns that would allow designers to browse through all these elemental and morphologically varied pattern variations within the same collection in quick succession.

发明内容Contents of the invention

本发明提供了一种在给定的两个图案之间采样出一些新图案的系统并提供了一种生成图案的交互式浏览界面。这些新图案既能保持源图案中的一些局部特征,也能带有一些变化,即使这些作为参考的源图案之间的元素数量,元素排列特征可能具有差异性。设计师在界面中能浏览到所有的这些元素和形态各不相同的图案结果。本发明主要解决了如何识别这些不同拓扑结构图案各自的形态特征并加以利用的问题以及如何在由排列特征,元素数量都有差异的新图案所组成的不同空间集合中进行采样的问题。同时提供了一种图案交互式浏览界面,能够让设计师随意地浏览所有可能搜索到的图案变体。The present invention provides a system for sampling some new patterns between given two patterns and provides an interactive browsing interface for generating patterns. These new patterns can not only maintain some local features in the source patterns, but also have some changes, even if the number of elements and element arrangement characteristics between these reference source patterns may be different. Designers can browse all these elements and pattern results with different shapes in the interface. The present invention mainly solves the problem of how to identify and utilize the respective morphological features of these different topological patterns and the problem of how to sample in different space sets composed of new patterns with different arrangement features and element quantities. At the same time, it provides an interactive browsing interface for patterns, which allows designers to freely browse all possible pattern variants that can be searched.

本发明至少通过如下技术方案之一实现。The present invention is realized through at least one of the following technical solutions.

一种结构可变的图案生成方法,包括以下步骤:A method for generating patterns with a variable structure, comprising the following steps:

S1、为图案中的元素构建关系图模型;S1. Construct a relational graph model for the elements in the pattern;

S2、采用能量方程的离散优化模型,在不同拓扑结构图案之间进行元素的匹配;S2. Using a discrete optimization model of the energy equation to match elements between different topological patterns;

S3、基于RJMCMC算法(Reverse Jump Markov Chain Monte Carlo,可逆跳转马尔科夫链蒙特卡洛算法),在不同拓扑结构图案之间采样,获得新的图案。S3. Based on the RJMCMC algorithm (Reverse Jump Markov Chain Monte Carlo, reversible jump Markov chain Monte Carlo algorithm), sampling between different topological patterns to obtain new patterns.

进一步的,步骤S1所述的关系包括元素的关系类型和关系的关系类型,其中元素的关系类型包括元素与元素之间的距离关系、元素与元素的方向夹角关系、元素与元素的尺寸比例关系;关系的关系类型包括元素之间保持的距离是等差或者等比关系、图案中某一个元素与其他元素的朝向之间的夹角关系。Further, the relationship described in step S1 includes the relationship type of the element and the relationship type of the relationship, wherein the relationship type of the element includes the distance relationship between elements, the direction angle relationship between elements, and the size ratio between elements Relationship; the relationship type of relationship includes that the distance between elements is equal difference or proportional relationship, and the angle relationship between the orientation of a certain element in the pattern and the orientation of other elements.

进一步的,步骤S1构建的关系图模型是用来描述图案中的元素间的关系以及关系间的关系;Further, the relationship diagram model constructed in step S1 is used to describe the relationship between elements in the pattern and the relationship between the relationships;

关系图模型包括关系图向量,一个关系图向量代表一个图案;关系图向量是一个一维向量,由三个部分组成,其中第一个部分依次是图案中每个元素的位置(x,y)、朝向θ和尺寸s这三个信息,第二个部分包含元素与元素之间关系的值,第三个部分是关系值r,所述关系值r包括元素与元素的关系值和关系的关系值,关系图向量μ如下:The relationship diagram model includes a relationship diagram vector, a relationship diagram vector represents a pattern; a relationship diagram vector is a one-dimensional vector consisting of three parts, the first part of which is the position (x, y) of each element in the pattern in turn , orientation θ, and size s, the second part contains the value of the relationship between elements, and the third part is the relationship value r, which includes the relationship value between elements and the relationship between elements value, the relationship diagram vector μ is as follows:

μ=(x1,y11,s1,x2,y22,s2,...,xi,yii,si,r1,r2,r3,...,ri) (1)μ=(x 1 ,y 11 ,s 1 ,x 2 ,y 22 ,s 2 ,..., xi ,y ii ,s i ,r 1 ,r 2 ,r 3 ,...,r i ) (1)

关系图模型通过有向图

Figure BDA0002067313830000021
进行表示,有向图的节点N=E∪R,其中E是图案中元素的集合,第i个元素表示为Ei=(xi,yii,si),Ei∈E,i表示元素的数量;R是图案中关系的集合,R=RE∪RR,RE是元素关系集合,RR是关系间的关系集合,每一个关系有相应的关系值,其中第i个关系的关系值表示为Ri=(ri),Ri∈R;将节点Ni对应关系图向量的所有的元素信息或关系值记做
Figure BDA0002067313830000022
Figure BDA0002067313830000023
以及
Figure BDA0002067313830000024
其中Ej∈E;有向图的边A={(Ni1,Ri),(Ni2,Ri)}i=1...k+l,其中k是关系图模型中元素关系的数量,l是关系的关系数量。例如Ni1和节点Ni2是均与关系值Ri相关的元素E1和元素E2或者关系R1和关系R2,其中Ri的值由节点Ni1和节点Ni2的值计算得到;Relational graph models through directed graphs
Figure BDA0002067313830000021
For representation, the node N=E∪R of the directed graph, where E is the set of elements in the pattern, and the i-th element is expressed as E i =( xi ,y ii ,s i ), E i ∈ E , i represents the number of elements; R is the set of relations in the pattern, R = R ER R , R E is the set of element relations, R R is the set of relations between relations, and each relation has a corresponding relation value, among which The relationship value of i relationship is expressed as R i = (ri ), R i R; write all the element information or relationship value of node N i corresponding to the relationship graph vector as
Figure BDA0002067313830000022
Figure BDA0002067313830000023
as well as
Figure BDA0002067313830000024
where E j ∈ E; the edge A of the directed graph={(N i1 ,R i ),(N i2 ,R i )} i=1...k+l , where k is the element relationship in the relational graph model Quantity, l is the relation number of relations. For example, N i1 and node N i2 are element E 1 and element E 2 or relationship R 1 and relationship R 2 that are both related to the relationship value R i , where the value of R i is calculated from the values of node N i1 and node N i2 ;

具体地,具体地,元素的关系类型共有6种,关系的关系类型有3种,其中,6种元素的关系类型为:Specifically, there are 6 types of relationship of elements and 3 types of relationship of relationship, among which, the relationship types of 6 elements are:

1)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心的距离被定义为元素之间的欧几里德距离关系,其中关系值Ri的值为:1), the distance between an element E a in the representative pattern and the center of another element E b in the representative pattern is defined as the Euclidean distance relationship between the elements, wherein the value of the relationship value R i is:

Figure BDA0002067313830000025
Figure BDA0002067313830000025

其中,(xa,ya)为元素Ea的位置,(xa,yb)为元素Eb的位置;Wherein, (x a , y a ) is the position of element E a , (x a , y b ) is the position of element E b ;

2)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的方向之间的角度差被定义为元素之间的方向差关系,关系值Ri的取值范围为[-π,π],顺时针的角度变化为负数:2), the angle difference between an element E a in the representative pattern and the direction of another element E b in the representative pattern is defined as the direction difference relationship between the elements, and the value range of the relation value R i is [- π,π], clockwise angle changes are negative:

Figure BDA0002067313830000026
Figure BDA0002067313830000026

Figure BDA0002067313830000027
Figure BDA0002067313830000027

其中,θa和θb分别为Ea和Eb的朝向;Among them, θ a and θ b are the orientations of E a and E b respectively;

3)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的大小之间的差被定义为元素之间的大小差关系,关系值Ri3), the difference between the size of an element E a in the representative pattern and the size of another element E b in the representative pattern is defined as the size difference relationship between the elements, the relationship value R i :

Ri=sa-sb R i =s a -s b

其中,Sa和Sb分别为Ea和Eb的尺寸;Wherein, S a and S b are the dimensions of E a and E b respectively;

4)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心点之间的连线与X轴之间的夹角被定义为绝对角度差关系,关系值Ri的取值范围为[-π,π],顺时针的角度变化为负数:4), the angle between the connection line between an element E a in the representative pattern and the central point of another element E b in the representative pattern and the X axis is defined as the absolute angle difference relationship, and the relationship value R i The value range is [-π,π], and the clockwise angle change is negative:

Figure BDA0002067313830000031
Figure BDA0002067313830000031

Figure BDA0002067313830000032
Figure BDA0002067313830000032

5)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心点之间的连线与元素Ea的方向之间的夹角被定义为元素之间的相对角度差关系,关系值Ri的取值范围为[-π,π],顺时针的角度变化为负数:5), the angle between the line between an element E a in the representative pattern and the center point of another element E b in the representative pattern and the direction of the element E a is defined as the relative angle difference between the elements Relationship, the value range of the relationship value R i is [-π, π], and the clockwise angle change is a negative number:

Figure BDA0002067313830000033
Figure BDA0002067313830000033

Figure BDA0002067313830000034
Figure BDA0002067313830000034

6)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心点之间的连线与元素Ea的方向之间的夹角的绝对值被定义为元素之间的对称角度差关系,关系值Ri的取值范围为[0,π],顺时针和逆时针的角度变化均为正数:6), the absolute value of the angle between the line between an element E a in the representative pattern and the center point of another element E b in the representative pattern and the direction of the element E a is defined as the angle between the elements Symmetric angle difference relationship, the value range of the relationship value R i is [0, π], and the angle changes of clockwise and counterclockwise are both positive numbers:

Figure BDA0002067313830000035
Figure BDA0002067313830000035

所述3种关系的关系类型分别为:The relationship types of the three relationships are:

3-1)、两个不是角度关系的关系Ev和Ed,其值Rv和Rd的差被定义为关系差的关系,关系值Ri的取值:3-1), two relations E v and E d that are not angular relations, the difference between their values R v and R d is defined as the relation of relation difference, the value of relation value R i :

Ri=Rv-Rd R i =R v -R d

3-2)、两个角度关系Ev和Ed的值Rv和Rd的差被定义为角度关系差的关系,关系值Ri的取值范围为[0,π]3-2), the difference between the values R v and R d of two angular relationships E v and E d is defined as the relationship between the difference in angular relationship, and the value range of the relationship value R i is [0, π]

Figure BDA0002067313830000036
Figure BDA0002067313830000036

Figure BDA0002067313830000037
Figure BDA0002067313830000037

3-3)、两个关系Ev和Ed的值Rv和Rd的商被定义为关系商的关系值Ri3-3), the quotient of the values R v and R d of two relations E v and E d is defined as the relation value R i of the relation quotient:

Ri=Rv/Rd R i =R v /R d

进一步的,步骤S2所述的基于能量方程的离散优化模型如下:Further, the energy equation-based discrete optimization model described in step S2 is as follows:

Figure BDA0002067313830000041
Figure BDA0002067313830000041

使得

Figure BDA0002067313830000042
make
Figure BDA0002067313830000042

其中,m和n分别是进行元素匹配的图案a和图案b的元素个数,Xij是用于指定一个图案中的第i个元素是否与另外一个图案的第j个元素对应,i∈m,j∈n;Xij为1表示元素i和元素j存在对应关系,否则不存在;Vij用于指定当Xij为1时,该对应带来的消耗;元素与元素之间对应的消耗定义为两个元素之间的欧式距离;λ是权重,用于平衡离散优化模型中的前一项

Figure BDA0002067313830000043
与后一项
Figure BDA0002067313830000044
Among them, m and n are the number of elements of pattern a and pattern b for element matching respectively, X ij is used to specify whether the i-th element in a pattern corresponds to the j-th element of another pattern, i∈m , j∈n; X ij being 1 means that there is a corresponding relationship between element i and element j, otherwise it does not exist; V ij is used to specify the consumption caused by the correspondence when X ij is 1; the corresponding consumption between elements Defined as the Euclidean distance between two elements; λ is the weight used to balance the previous term in the discrete optimization model
Figure BDA0002067313830000043
with the latter
Figure BDA0002067313830000044

后一项用于避免一个图案中的两个对称的元素分别对应到其他图案中两个不对称的图案,因此,建立一个列表,列表中的每一项是一个四元素(p,q,g,h),其中p和g表示图案a中的第p和第q个元素是对称关系,q和h表示图案a中的第q和第h个元素是对称关系;设该列表的长度为K,则后一项中第k个列表计算式的Sk定义为:The latter item is used to avoid that two symmetrical elements in one pattern correspond to two asymmetrical patterns in other patterns respectively. Therefore, a list is established, and each item in the list is a four-element (p,q,g , h), where p and g indicate that the pth and qth elements in pattern a are in a symmetrical relationship, and q and h indicate that the qth and hth elements in pattern a are in a symmetrical relationship; let the length of the list be K , then the S k of the kth list calculation formula in the latter item is defined as:

Figure BDA0002067313830000045
Figure BDA0002067313830000045

其中Xp,g是用于指定图案a中的第p个元素是否与图案b中的第q个元素对应,Xq,h是用于指定图案a中的第q个元素是否与图案b的第h个元素对应,

Figure BDA0002067313830000046
是异或操作;Where X p, g is used to specify whether the p-th element in pattern a corresponds to the q-th element in pattern b, and X q, h is used to specify whether the q-th element in pattern a corresponds to the q-th element in pattern b The hth element corresponds to,
Figure BDA0002067313830000046
is an XOR operation;

同时该离散优化模型需要满足如下的三个约束条件,

Figure BDA0002067313830000047
表示图案a中的每一个元素至少要与图案b中的一个元素存在对应关系;
Figure BDA0002067313830000048
则表示图案b中的每一个元素也至少要与图案a中的一个元素存在对应关系;
Figure BDA0002067313830000049
则表示当图案a中的第i个元素与图案b中的第j个元素产生对应关系后,如果图案a中的第i个元素与图案b中的不是第j个元素的其他元素产生对应,则图案b中的第j个元素不能再与图案a中不是的第i个元素的其他元素产生对应;同样如果图案b中的第j个元素与图案a中的不是第i个元素的其他元素产生对应,则图案a中的第i个元素不能再与图案b中不是的第j个元素的其他元素产生对应。At the same time, the discrete optimization model needs to meet the following three constraints:
Figure BDA0002067313830000047
Indicates that each element in pattern a must have a corresponding relationship with at least one element in pattern b;
Figure BDA0002067313830000048
Then it means that each element in the pattern b also has a corresponding relationship with at least one element in the pattern a;
Figure BDA0002067313830000049
It means that when the i-th element in pattern a corresponds to the j-th element in pattern b, if the i-th element in pattern a corresponds to other elements in pattern b that are not the j-th element, Then the j-th element in pattern b can no longer correspond to other elements in pattern a that are not the i-th element; similarly, if the j-th element in pattern b matches other elements in pattern a that are not the i-th element Correspondingly, the i-th element in pattern a can no longer correspond to other elements in pattern b that are not the j-th element.

进一步的,步骤S3采用RJMCMC采样算法在不同拓扑结构的图案之间获得既能保持原始图案中的局部特征的同时也能有一些额外变化的新图案,在采集过程中,RJMCMC算法维持一个随机变量的维度可变的马尔科夫链,该马尔科夫链中不断生成的随机变量,在迭代过程中逐渐趋近于一个固定的概率分布p直至概率分布p完全稳定,接下来从该马尔科夫链中采样得到的所有的随机变量均满足这个固定的概率分布;Further, step S3 uses the RJMCMC sampling algorithm to obtain new patterns that can not only maintain the local characteristics of the original pattern but also have some additional changes between the patterns of different topological structures. During the acquisition process, the RJMCMC algorithm maintains a random variable The variable-dimensional Markov chain of Markov chain, the random variable continuously generated in the Markov chain gradually approaches a fixed probability distribution p in the iterative process until the probability distribution p is completely stable, and then from the Markov chain All random variables sampled in the chain satisfy this fixed probability distribution;

所述的RJMCMC算法如下:The described RJMCMC algorithm is as follows:

设定概率密度函数:Specify the probability density function:

Figure BDA0002067313830000051
Figure BDA0002067313830000051

其中,p表示概率分布,Z是使分布归一化的配分函数,在RJMCMC算法不需要计算配分函数的情况下进行采样,F为能量函数;Among them, p represents the probability distribution, Z is the partition function that normalizes the distribution, sampling is performed when the RJMCMC algorithm does not need to calculate the partition function, and F is the energy function;

F=F(μ,μab) (4)F=F(μ,μ ab ) (4)

关系图向量μ的概率密度函数表示为:The probability density function of the graph vector μ is expressed as:

Figure BDA0002067313830000052
Figure BDA0002067313830000052

其中,β为由人为设定的温度系数;Among them, β is the temperature coefficient set artificially;

采样过程具体为:将图案a的关系图向量μa和图案b的关系图向量μb输入RJMCMC算法,μa∈μ,μb∈μ,μa将作为马尔科夫链的初始变量以e0表示,马尔科夫链得到的每一个变量ei代表一个关系图向量μi即代表着一个新的图案;The specific sampling process is as follows: input the relationship graph vector μ a of pattern a and the relationship graph vector μ b of pattern b into the RJMCMC algorithm, μ a ∈ μ, μ b ∈ μ, μ a will be used as the initial variable of the Markov chain with e 0 means that each variable e i obtained by the Markov chain represents a relationship graph vector μ i represents a new pattern;

RJMCMC算法在每次迭代得到马尔科夫链的新变量的过程中,首先会随机选择漫移操作或者跳跃操作中的其中一种操作;如果得到马尔科夫链中第m个变量em的第m次迭代选择了漫移操作,则马尔科夫链的新变量em将通过在上一个变量em-1中代表的关系图向量μ的任意一项μi上加上一个从正态分布

Figure BDA0002067313830000053
中采样的偏移量得到,该正态分布
Figure BDA0002067313830000054
将由人为指定;In the process of obtaining new variables of the Markov chain in each iteration of the RJMCMC algorithm, it first randomly selects one of the roaming operations or jump operations; if the mth variable e m in the Markov chain is obtained The m iterations select the roaming operation, then the new variable e m of the Markov chain will add a value from the normal distribution to any item μ i of the relationship graph vector μ represented by the previous variable em -1
Figure BDA0002067313830000053
The offset of sampling in is obtained, the normal distribution
Figure BDA0002067313830000054
will be manually designated;

如果得到马尔科夫链中第i个变量xi的第i次迭代选择了跳跃操作,则马尔科夫链的新变量xi的候选变量xi'将通过在上一个变量xi-1中随机增加或者减少向量的维度得到,具体的,在变量xi-1代表的关系图向量μi-1中根据步骤S2中计算的元素的对应关系随机选择一组元素的对应关系,并将新的元素加入该对应关系中缺少新元素的图案,新的元素的四个信息随机生成,同时产生新的元素与关系图向量μi-1所对应的图案中的元素之间的关系,或者减去多出的元素,同时消去多出的元素与关系图向量μi-1所对应的图案中的元素关系,形成新的关系图向量μiIf the i-th iteration of the i-th variable x i in the Markov chain chooses the jump operation, the candidate variable x i ' of the new variable x i of the Markov chain will be passed in the previous variable x i-1 Randomly increase or decrease the dimension of the vector to obtain, specifically, in the relationship graph vector μ i- 1 represented by the variable x i-1 , randomly select a group of corresponding relationships of elements according to the corresponding relationship of elements calculated in step S2, and put the new The elements of the corresponding relationship are added to the patterns that lack new elements, and the four information of the new elements are randomly generated, and at the same time, the relationship between the new elements and the elements in the pattern corresponding to the relationship graph vector μ i-1 is generated, or subtracted Remove the extra elements, and at the same time eliminate the relationship between the extra elements and the elements in the pattern corresponding to the relationship diagram vector μ i-1 , to form a new relationship diagram vector μ i ;

RJMCMC算法根据如下接受拒绝概率来选择是否接受候选变量x'i成为新变量xiThe RJMCMC algorithm selects whether to accept the candidate variable x' i as the new variable x i according to the acceptance and rejection probability as follows:

Figure BDA0002067313830000061
Figure BDA0002067313830000061

Figure BDA0002067313830000062
Figure BDA0002067313830000062

其中

Figure BDA0002067313830000063
表示接受xi+1作为马尔科夫链中新变量的概率,取值[0,1],如果本次迭代选择漫移操作,则拒绝接受概率选择公式(6),其中p(μi+1)是使用关系图向量μi+1计算得到的概率密度;p(μi)是使用关系图向量μi计算得到的概率密度;如果本次迭代选择跳跃操作,则拒绝接受概率选择公式(7),其中q(μii+1)是从关系图向量μi+1通过增减向量的维度得到关系图向量μi的概率;q(μi+1i)是从关系图向量μi通过增减向量的维度得到关系图向量μi+1的概率;然后RJMCMC算法从一个0-1分布中随机采样一个数字t;如果数字t小于
Figure BDA0002067313830000064
则RJMCMC算法接受xi+1作为马尔科夫链中新变量;如果数字t大于
Figure BDA0002067313830000065
则RJMCMC算法不接受xi+1作为马尔科夫链中新变量,保持xi作为马尔科夫链中新变量;in
Figure BDA0002067313830000063
Indicates the probability of accepting x i+1 as a new variable in the Markov chain, and takes the value [0,1]. If the roaming operation is selected for this iteration, the probability selection formula (6) is rejected, where p(μ i+ 1 ) is the probability density calculated by using the relationship graph vector μ i+1 ; p(μ i ) is the probability density calculated by using the relationship graph vector μ i ; if the jump operation is selected for this iteration, the probability selection formula ( 7), where q(μ ii+1 ) is the probability of obtaining the relationship graph vector μ i from the relationship graph vector μ i+1 by increasing or decreasing the dimension of the vector; q(μ i+1i ) is obtained from The relationship graph vector μ i obtains the probability of the relationship graph vector μ i+1 by increasing or decreasing the dimension of the vector; then the RJMCMC algorithm randomly samples a number t from a 0-1 distribution; if the number t is less than
Figure BDA0002067313830000064
Then the RJMCMC algorithm accepts x i+1 as a new variable in the Markov chain; if the number t is greater than
Figure BDA0002067313830000065
Then the RJMCMC algorithm does not accept xi+1 as a new variable in the Markov chain, and keeps xi as a new variable in the Markov chain;

经过一段时间的迭代后,RJMCMC算法中马尔科夫链的随机变量根据式(5)计算得到的值出现的次数概率将等于这个计算得到的值,这些变量将作为RJMCMC算法采样得到的结果。After a period of iterations, the probability of occurrences of the random variables of the Markov chain in the RJMCMC algorithm calculated according to formula (5) will be equal to the calculated value, and these variables will be used as the sampling results of the RJMCMC algorithm.

进一步的,在两个图案之间构建如下能量函数,用于度量步骤S3新采样得到的新图案的好坏:Further, the following energy function is constructed between the two patterns, which is used to measure the quality of the new pattern obtained by the new sampling in step S3:

Figure BDA0002067313830000066
Figure BDA0002067313830000066

其中,μ是新的图案中元素的关系图向量,μa和μb分别是给定的图案a和图案b中元素的关系图向量;α是能量函数中第一项的权重;能量函数中第一项Fvalid(μ)定义为:Among them, μ is the relationship diagram vector of the elements in the new pattern, μ a and μ b are the relationship diagram vectors of the elements in the given pattern a and pattern b respectively; α is the weight of the first item in the energy function; in the energy function The first term F valid (μ) is defined as:

Fvalid(μ)=μ-σ(μ) (9)F valid (μ)=μ-σ(μ) (9)

其中σ(μ)是关系图向量中的元素与其关系的实际值所组成的新的向量集合Where σ(μ) is a new set of vectors composed of the elements in the relationship diagram vector and the actual value of their relationship

Figure BDA0002067313830000067
Figure BDA0002067313830000067

其中σi(μ)代表σ(μ)向量中的第i项,μi代表μ向量中的第i项,如果μ中的第i项是图案中一个元素的信息,则σ(μ)中的第i项保持μ中的第i项的值依旧表示图案中该元素的相同信息;如果μ中的第i项是图案中一个元素与元素之间的关系的值,σ(μ)中的第i项则是该关系实际的值;

Figure BDA0002067313830000068
则是从节点Ni所代表的元素的若干个信息中获取到计算所需要的位置信息、方向信息或者角度信息,则
Figure BDA0002067313830000071
表示根据节点Ni所代表的关系类型利用其相关的两个输入节点Ni1和Ni2所包含的相应的元素信息计算出该关系的实际值;如果μ中的第i项是关系图向量中一个关系与关系之间的关系值,σ(μ)中的第i项同样是该关系的实际值,则
Figure BDA0002067313830000072
表示根据节点Ni所代表的关系类型利用其相关的两个输入节点Ni1和Ni2所包含的关系值计算出该关系的实际值;Where σ i (μ) represents the i-th item in the σ(μ) vector, and μ i represents the i-th item in the μ vector, if the i-th item in μ is the information of an element in the pattern, then in σ(μ) The i-th item in μ keeps the value of the i-th item in μ still representing the same information of the element in the pattern; if the i-th item in μ is the value of the relationship between an element and an element in the pattern, the value of the i-th item in σ(μ) The i item is the actual value of the relationship;
Figure BDA0002067313830000068
It is to obtain the position information, direction information or angle information required for the calculation from several pieces of information of the elements represented by the node N i , then
Figure BDA0002067313830000071
Indicates that according to the relationship type represented by node N i , the actual value of the relationship is calculated by using the corresponding element information contained in the two related input nodes N i1 and N i2 ; if the i-th item in μ is in the relationship graph vector The relationship value between a relationship and the relationship, the i-th item in σ(μ) is also the actual value of the relationship, then
Figure BDA0002067313830000072
Indicates that according to the relationship type represented by node N i , the actual value of the relationship is calculated by using the relationship values contained in the two related input nodes N i1 and N i2 ;

β是能量函数中第二项的权重,用户约束采样得到的新图案中的一些元素是保持给定的图案a和图案b中的一些元素的位置、大小和方向,因此Fconstrain(μ,μab)定义为衡量新图案的关系图向量中受到约束的元素的信息与其指定的图案中的元素的信息之间的差距:β is the weight of the second item in the energy function. Some elements in the new pattern obtained by user constraint sampling are to maintain the position, size and direction of some elements in the given pattern a and pattern b, so F constrain (μ,μ a , μ b ) is defined as the measure of the gap between the information of the constrained elements in the graph vector of the new pattern and the information of the elements in the specified pattern:

Fconstrain(μ,μab)=μ{Eca}-μa{Ec'a}+μ{Ecb}-μb{E'cb} (11)F constrain (μ,μ ab )=μ{E ca }-μ a {E c ' a }+μ{E cb }-μ b {E' cb } (11)

其中Eca表示新图案中受到约束需要保持图案a中的元素信息的元素集合,E'ca表示Eca中的元素需要保持的图案a中的元素集合;Ecb表示新图案中受到约束需要保持图案b中的元素信息的元素集合,E'cb表示Ecb中的元素需要保持的图案b中的元素集合;μ{Eca}表示Eca集合中的元素在新图案的关系图向量μ中的元素信息;μa{E'ca}表示E'ca集合中的元素在图案a的关系图向量μa中的元素信息;μb{E'cb}表示E'cb集合中的元素在图案b的关系图向量μb中的元素信息;Where E ca represents the set of elements in the new pattern that are constrained to keep the element information in pattern a, E' ca represents the set of elements in pattern a that the elements in E ca need to maintain; E cb represents the set of elements in the new pattern that are constrained and need to maintain The element set of element information in pattern b, E' cb means the element set in pattern b that the elements in E cb need to keep; μ{E ca } means that the elements in the E ca set are in the relationship graph vector μ of the new pattern μ a {E' ca } means the element information of the elements in the E' ca set in the pattern a vector μ a ; μ b {E' cb } means the elements in the E' cb set are in the pattern The element information in the relationship diagram vector μ b of b;

γ是能量函数中第三项的权重,Fgroup(μ)定义为衡量对称关系组与其平均值之间的差距:γ is the weight of the third term in the energy function, and F group (μ) is defined to measure the distance between the symmetric relation group and its mean value:

Figure BDA0002067313830000073
Figure BDA0002067313830000073

Fgroup(μ)是由关系图向量μ中所有对称关系组与其平均值之间的差距所组成的一维向量,图案中的元素对称性在关系图向量中表现为关系值,G表示对称关系组的关系值相等的集合,设新生成的图案中有H个关系值相等的集合,μ{Gh}表示第h个集合中的关系在关系图向量中的值所组成的向量,H=1~h,

Figure BDA0002067313830000074
表示第h个集合中所有关系值的平均值。F group (μ) is a one-dimensional vector composed of the gap between all symmetric relationship groups in the relationship graph vector μ and their average value. The symmetry of elements in the pattern is expressed as the relationship value in the relationship graph vector, and G indicates the symmetric relationship Sets with equal relationship values in the group, assuming that there are H sets with equal relationship values in the newly generated pattern, μ{G h } represents the vector composed of the values of the relationship in the hth set in the relationship graph vector, H= 1~h,
Figure BDA0002067313830000074
Denotes the average of all relation values in the hth set.

δ是能量函数中第四项的权重,从给定的图案a和图案b中随机选择一个图案作为新图案的指导图案,该指导图案的关系图向量表示为τ,因此Flocal(μ,τ)定义为衡量新图案与指导图案之间的差距:δ is the weight of the fourth item in the energy function, randomly select a pattern from the given pattern a and pattern b as the guiding pattern of the new pattern, and the relationship graph vector of the guiding pattern is expressed as τ, so F local (μ,τ ) is defined as a measure of the gap between the new pattern and the guide pattern:

Flocal(μ,τ)=μ-τ (13)F local (μ,τ)=μ-τ (13)

最终,从能量方程来说一个最好的图案满足:图案中的关系的实际值与图案对应的关系向量图μ中的关系值相等;图案对应的关系向量图μ中的关系值与其所在的对称关系组中关系值的平均值相等;图案中受到约束的元素的信息与需要保持的元素的信息相等;图案对应的关系向量图μ与指导关系向量图τ相等;Finally, from the energy equation, a best pattern satisfies: the actual value of the relationship in the pattern is equal to the relationship value in the relationship vector diagram μ corresponding to the pattern; the relationship value in the relationship vector diagram μ corresponding to the pattern is symmetrical to its location The average value of the relationship value in the relationship group is equal; the information of the constrained elements in the pattern is equal to the information of the elements that need to be kept; the relationship vector graph μ corresponding to the pattern is equal to the guiding relationship vector graph τ;

一种利用图案生成浏览界面方法,包括以下步骤:A method for generating a browsing interface by using patterns, comprising the following steps:

1)、获取采样得到的新图案的高维向量表达特征,得到高维向量空间;所述高位向量表达特征采用该图案的关系图向量表示;1), obtain the high-dimensional vector expression feature of the new pattern obtained by sampling, and obtain the high-dimensional vector space; the high-level vector expression feature adopts the relationship diagram vector representation of the pattern;

2)、采用GPLVM(Gaussian Process Latent Variable Model,高斯过程隐变量模型)将高维向量空间压缩到二维流形空间;2), using GPLVM (Gaussian Process Latent Variable Model, Gaussian process latent variable model) to compress the high-dimensional vector space into a two-dimensional manifold space;

3)、将二维流形空间中的点逆映射到高维空间中,得到新的图案,并对其进行后处理;3) Inversely map the points in the two-dimensional manifold space to the high-dimensional space to obtain a new pattern, and perform post-processing on it;

4)、生成图案浏览界面,所述图案浏览界面分为两个部分,一部分是得到的二维流形热图,用户通过鼠标在二维流形热图上滑动,另一部分会出现相应的新图案。4), generate a pattern browsing interface, the pattern browsing interface is divided into two parts, one part is the obtained two-dimensional manifold heat map, the user slides on the two-dimensional manifold heat map through the mouse, and the other part will appear corresponding new pattern.

进一步的,步骤2)的Further, step 2) of

压缩是使用高斯过程隐变量模型工具箱,该工具箱将高维向量表达特征降维成二维向量,形成二维流形空间,所有的二维向量作为相应的坐标,所述坐标确定采样结果的高维向量空间的二维流形。同时工具箱还会计算该高维向量空间中所有的图案与采样结果的协方差值,协方差值越大,二维流形上展示的颜色越红;协方差值越小,二维流形上展示的颜色越蓝,最终形成一张二维流形热图。Compression is to use the Gaussian process hidden variable model toolbox, which reduces the dimensionality of high-dimensional vector expression features into two-dimensional vectors to form a two-dimensional manifold space, and all two-dimensional vectors are used as corresponding coordinates, and the coordinates determine the sampling results The two-dimensional manifold of the high-dimensional vector space of . At the same time, the toolbox will also calculate the covariance value of all patterns and sampling results in the high-dimensional vector space. The larger the covariance value, the redder the color displayed on the two-dimensional manifold; the smaller the covariance value, the two The bluer the color displayed on the two-dimensional manifold, the final form is a two-dimensional manifold heat map.

进一步的,步骤3)具体是通过高斯过程隐变量模型工具箱将二维流形空间中的点的坐标逆映射到得到相应的新关系图向量。一个全新的关系图向量确定一个全新的图案。Further, step 3) is specifically to use the Gaussian process hidden variable model toolbox to inversely map the coordinates of the points in the two-dimensional manifold space to obtain a corresponding new relationship graph vector. A whole new diagram vector defines a whole new pattern.

进一步的,步骤3)是通过如下的图案修复函数进行后处理,用于修复图案中存在的对称关系:Further, step 3) is to perform post-processing through the following pattern repair function to repair the symmetric relationship existing in the pattern:

Figure BDA0002067313830000081
Figure BDA0002067313830000081

其中μ*是满足式(14)的最小值的图案关系图向量,μ是修复函数的变量,μ0是需要通过此函数进行修复的图案的关系图向量。Among them, μ * is the vector of the pattern relationship diagram satisfying the minimum value of formula (14), μ is the variable of the repair function, and μ 0 is the vector of the relationship diagram of the pattern that needs to be repaired by this function.

本发明的有益效果是:本发明基于遗传算法的元素对应分配方案能够有效地记录这些不同拓扑结构图案之间变形所产生的例如分裂和合并等特殊物理效果。通过RJMCMC采样算法能够稳定获得在两个不同拓扑结构的源图案之间大量的既能保持多个源图案中的局部特征的同时也能有一些额外变化的新图案。GPLVM算法能够学习这些采样结果所处的高维空间并通过低维度流形的方法表达这个高维空间,在该空间中能够统一快速地浏览一些带有连续变化效果的新图案。The beneficial effect of the present invention is that: the genetic algorithm-based element correspondence allocation scheme of the present invention can effectively record special physical effects such as splitting and merging caused by deformation between these different topological structure patterns. The RJMCMC sampling algorithm can stably obtain a large number of new patterns between two source patterns with different topological structures, which can not only maintain the local characteristics of multiple source patterns, but also have some additional changes. The GPLVM algorithm can learn the high-dimensional space in which these sampling results are located and express this high-dimensional space through the method of low-dimensional manifolds. In this space, some new patterns with continuous changing effects can be browsed uniformly and quickly.

附图说明Description of drawings

图1是实施例中一种结构可变的图案生成和利用图案生成浏览界面的方法流程图;Fig. 1 is a flow chart of a method for generating a structurally variable pattern and using the pattern to generate a browsing interface in an embodiment;

图2是本实施例一个图案的两个层次的属性的示意图;Fig. 2 is a schematic diagram of attributes of two levels of a pattern in the present embodiment;

图3是本实施例一个图案的关系图向量的有向图;Fig. 3 is the directed graph of the relation diagram vector of a pattern of the present embodiment;

图4是本实施例中需要进行元素配对的图案a和图案b;Fig. 4 is pattern a and pattern b that need to carry out element pairing in this embodiment;

图5是本实施例对图4两个图案的元素进行配对的结果图;Fig. 5 is the result figure of this embodiment pairing the elements of the two patterns in Fig. 4;

图6是本实施例RJMCMC算法得到的新图案;Fig. 6 is the new pattern that present embodiment RJMCMC algorithm obtains;

图7是本实施例RJMCMC算法得到的另外一个新图案;Fig. 7 is another new pattern obtained by the RJMCMC algorithm of the present embodiment;

图8是本实施例的图案所生成浏览界面示意图。FIG. 8 is a schematic diagram of the browsing interface generated by patterns in this embodiment.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention.

如图1所示的一种结构可变的图案生成方法,包括以下步骤:A method for generating patterns with a variable structure as shown in Figure 1, comprising the following steps:

S1、为原始图案中的元素构建关系图模型;S1. Construct a relational graph model for the elements in the original pattern;

步骤S1所述的原始图案都是由元素组成。这些图案的元素具有强烈的几何排列特征。图案的元素与元素之间有一定的关系,这些关系之间还存在更高级的关系,即关系的关系,步骤S1所述的关系包括元素的关系类型和关系的关系类型,其中元素的关系类型包括元素与元素之间的距离关系、元素与元素的方向夹角关系、元素与元素的尺寸比例关系;关系的关系类型包括元素之间保持的距离是等差或者等比关系、图案中某一个元素与其他元素的朝向之间的夹角均保持一致的关系等。The original pattern described in step S1 is composed of elements. The elements of these patterns are characterized by a strong geometric arrangement. There is a certain relationship between the elements of the pattern, and there is a higher-level relationship between these relationships, that is, the relationship of the relationship. The relationship described in step S1 includes the relationship type of the element and the relationship type of the relationship, wherein the relationship type of the element Including the distance relationship between elements, the direction angle relationship between elements, and the size ratio relationship between elements; the relationship type includes the distance between elements is equal difference or proportional relationship, a certain pattern in the pattern The angles between the elements and the orientations of other elements maintain a consistent relationship, etc.

本实施例中的图案共有六种元素的关系类型以及三种关系的关系类型。The pattern in this embodiment has six element relationship types and three relationship relationship types.

六种元素的关系类型分别为:The relationship types of the six elements are:

(1)代表图案①中的一个元素E1和代表图案②中的另一个元素E2的中心的距离被定义为元素之间的欧几里德距离关系。(2)代表图案中的一个元素E1和代表图案中的另一个元素E2的方向之间的角度差被定义为元素之间的方向差关系。关系值的取值范围为[-π,π],顺时针的角度变化为负数。(3)代表图案中的一个元素E1和代表图案中的另一个元素E2的大小之间的差被定义为元素之间的大小差关系。(4)代表图案中的一个元素E1和代表图案中的另一个元素E2的中心点之间的连线与X轴之间的夹角被定义为绝对角度差关系。关系值的取值范围为[-π,π],顺时针的角度变化为负数。(5)代表图案中的一个元素E1和代表图案中的另一个元素E2的中心点之间的连线与元素E1的方向之间的夹角被定义为元素之间的相对角度差关系。关系值的取值范围为[-π,π],顺时针的角度变化为负数。(6)代表图案中的一个元素E1和代表图案中的另一个元素E2的中心点之间的连线与元素E1的方向之间的夹角的绝对值被定义为元素之间的对称角度差关系。关系值的取值范围为[0,π],顺时针和逆时针的角度变化均为正数。(5)和(6)之间的差别在于有没有求取绝对值。(1) The distance between the centers of one element E 1 in representative pattern ① and the center of another element E 2 in representative pattern ② is defined as the Euclidean distance relationship between elements. ( 2 ) The angle difference between the direction representing one element E1 in the pattern and the direction representing another element E2 in the pattern is defined as the direction difference relationship between elements. The value range of the relationship value is [-π, π], and the clockwise angle change is a negative number. (3) The difference between the size of one element E1 in the representative pattern and the size of another element E2 in the representative pattern is defined as the size difference relationship between the elements. (4) The angle between the line representing one element E 1 in the pattern and the center point representing another element E 2 in the pattern and the X axis is defined as the absolute angle difference relationship. The value range of the relationship value is [-π, π], and the clockwise angle change is a negative number. (5) The angle between the line representing one element E1 in the pattern and the center point representing another element E2 in the pattern and the direction of the element E1 is defined as the relative angle difference between the elements relation. The value range of the relationship value is [-π, π], and the clockwise angle change is a negative number. (6) The absolute value of the angle between the line representing one element E 1 in the pattern and the center point of another element E 2 in the pattern and the direction of the element E 1 is defined as the Symmetrical angle difference relationship. The value range of the relationship value is [0, π], and the angle changes both clockwise and counterclockwise are positive numbers. The difference between (5) and (6) is whether or not to obtain the absolute value.

三种关系的关系类型分别为:The relationship types of the three relationships are:

1.两个关系的差值R1-R2被定义为关系差的关系。2.两个角度关系的差值被定义为角度关系差的关系,关系值的取值范围为[0,π]。3.两个关系的商R1/R2被定义为关系商的关系。1. The difference R 1 -R 2 of two relations is defined as the relation of relation difference. 2. The difference between two angular relations is defined as the relation of the difference between the angular relations, and the value range of the relation value is [0, π]. 3. The quotient R 1 /R 2 of two relations is defined as the relation of the relation quotient.

一个图案有两个层属性:第一层属性是元素,第二层属性是排列,以图2中左边框内图案为例,图案虚线框中的部分有两个层次的属性,第一层属性是元素,第二层属性是排列,这里通过元素与元素之间的距离关系表示。A pattern has two layers of attributes: the first layer attribute is the element, and the second layer attribute is the arrangement. Take the pattern in the left frame in Figure 2 as an example, the part in the dotted line frame of the pattern has two layers of attributes, the first layer attribute is the element, and the second-level attribute is the arrangement, which is represented by the distance relationship between elements.

步骤S1采用了关系图模型来描述图案中的元素与元素之间的关系以及这些关系之间的关系。Step S1 uses a relational graph model to describe the relationship between elements in the pattern and the relationship between these relationships.

关系图模型可以通过关系图向量进行表示。具体设:μ是一个图案中元素的关系图向量。关系图向量是一个一维向量,由三个部分组成,其中第一个部分依次是图案中每个元素的位置(x,y)、朝向θ和尺寸s这三个信息,第二个部分包含元素与元素之间关系的值,第三个部分则是元素关系的关系的值。关系值(包含关系值和关系的关系值)在关系图向量中统一以r表示:A relational graph model can be represented by a relational graph vector. Specifically, it is assumed that μ is a graph vector of the elements in a pattern. The relationship graph vector is a one-dimensional vector consisting of three parts, the first part of which is the position (x, y), orientation θ, and size s of each element in the pattern in turn, and the second part contains The value of the relationship between elements and elements, and the third part is the value of the relationship between elements. The relationship value (including the relationship value and the relationship value of the relationship) is uniformly represented by r in the relationship graph vector:

μ=(x1,y11,s1,x2,y22,s2,...,r1,r2,r3,...)(1)μ=(x 1 ,y 11 ,s 1 ,x 2 ,y 22 ,s 2 ,...,r 1 ,r 2 ,r 3 ,...)(1)

关系图模型通过有向图

Figure BDA0002067313830000101
进行表示,有向图的节点N=E∪R,其中E是图案中元素的集合,第i个元素表示为Ei=(xi,yii,si),Ei∈E,i表示元素的数量;R是图案中关系的集合,R=RE∪RR,RE是元素关系集合,RR是关系间的关系集合,每一个关系有相应的关系值,其中第i个关系的关系值表示为Ri=(ri),Ri∈R;有向图的边A={(Ni1,Ri),(Ni2,Ri)}i=1...k+l,其中k是关系图模型中元素关系的数量,l是关系的关系的数量。根据节点Ni1和节点Ni2是与关系Ri相关的两个元素E1、E2或者关系R1、R2,其中Ri的值由节点Ni1和节点Ni2包含的值计算得到。Relational graph models through directed graphs
Figure BDA0002067313830000101
For representation, the node N=E∪R of the directed graph, where E is the set of elements in the pattern, and the i-th element is expressed as E i =( xi ,y ii ,s i ), E i ∈ E , i represents the number of elements; R is the set of relations in the pattern, R = R ER R , R E is the set of element relations, R R is the set of relations between relations, and each relation has a corresponding relation value, among which The relationship value of i relationship is expressed as R i =(ri ),R i ∈R; the edge A of the directed graph={(N i1 ,R i ),(N i2 ,R i )} i=1.. .k+l , where k is the number of element relations in the relational graph model and l is the number of relations of relations. According to the node N i1 and the node N i2 are two elements E 1 , E 2 or the relationship R 1 , R 2 related to the relationship R i , where the value of R i is calculated from the values contained in the node N i1 and the node N i2 .

将节点Ni对应关系图向量的所有的元素信息或关系值记做

Figure BDA0002067313830000102
Figure BDA0002067313830000103
以及
Figure BDA0002067313830000104
其中Ej∈E。Record all element information or relationship values of the node N i corresponding to the relationship graph vector as
Figure BDA0002067313830000102
Figure BDA0002067313830000103
as well as
Figure BDA0002067313830000104
where E j ∈ E.

具体地,图案共有6种元素的关系类型以及3种关系的关系类型,其中,6种元素的关系类型为:Specifically, there are 6 element relationship types and 3 relationship relationship types in the pattern, where the 6 element relationship types are:

1)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心的距离被定义为元素之间的欧几里德距离关系,Ea∈E,Eb∈E,其关系值Ri的值为:1), the distance between an element E a in the representative pattern and the center of another element E b in the representative pattern is defined as the Euclidean distance relationship between the elements, E a ∈ E, E b ∈ E, where The value of relation value R i is:

Figure BDA0002067313830000111
Figure BDA0002067313830000111

其中,(xa,ya)为元素Ea的位置,(xa,yb)为元素Eb的位置;Wherein, (x a , y a ) is the position of element E a , (x a , y b ) is the position of element E b ;

2)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的方向之间的角度差被定义为元素之间的方向差关系,关系值Ri的取值范围为[-π,π],顺时针的角度变化为负数:2), the angle difference between an element E a in the representative pattern and the direction of another element E b in the representative pattern is defined as the direction difference relationship between the elements, and the value range of the relation value R i is [- π,π], clockwise angle changes are negative:

Figure BDA0002067313830000112
Figure BDA0002067313830000112

Figure BDA0002067313830000113
Figure BDA0002067313830000113

其中,θa和θb分别为Ea和Eb的朝向;Among them, θ a and θ b are the orientations of E a and E b respectively;

3)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的大小之间的差被定义为元素之间的大小差关系,关系值Ri3), the difference between the size of an element E a in the representative pattern and the size of another element E b in the representative pattern is defined as the size difference relationship between the elements, the relationship value R i :

Ri=sa-sb R i =s a -s b

其中,Sa和Sb分别为Ea和Eb的尺寸;Wherein, S a and S b are the dimensions of E a and E b respectively;

4)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心点之间的连线与X轴之间的夹角被定义为绝对角度差关系,关系值Ri的取值范围为[-π,π],顺时针的角度变化为负数:4), the angle between the connection line between an element E a in the representative pattern and the central point of another element E b in the representative pattern and the X axis is defined as the absolute angle difference relationship, and the relationship value R i The value range is [-π,π], and the clockwise angle change is negative:

Figure BDA0002067313830000114
Figure BDA0002067313830000114

Figure BDA0002067313830000115
Figure BDA0002067313830000115

5)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心点之间的连线与元素Ea的方向之间的夹角被定义为元素之间的相对角度差关系,关系值Ri的取值范围为[-π,π],顺时针的角度变化为负数:5), the angle between the line between an element E a in the representative pattern and the center point of another element E b in the representative pattern and the direction of the element E a is defined as the relative angle difference between the elements Relationship, the value range of the relationship value R i is [-π, π], and the clockwise angle change is a negative number:

Figure BDA0002067313830000116
Figure BDA0002067313830000116

Figure BDA0002067313830000117
Figure BDA0002067313830000117

6)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心点之间的连线与元素Ea的方向之间的夹角的绝对值被定义为元素之间的对称角度差关系,关系值Ri的取值范围为[0,π],顺时针和逆时针的角度变化均为正数:6), the absolute value of the angle between the line between an element E a in the representative pattern and the center point of another element E b in the representative pattern and the direction of the element E a is defined as the angle between the elements Symmetric angle difference relationship, the value range of the relationship value R i is [0, π], and the angle changes of clockwise and counterclockwise are both positive numbers:

Figure BDA0002067313830000118
Figure BDA0002067313830000118

所述3种关系的关系类型分别为:The relationship types of the three relationships are:

3-1)、两个不是角度关系的关系Ev和Ed,其值Rv和Rd的差被定义为关系差的关系,关系值Ri的取值:3-1), two relations E v and E d that are not angular relations, the difference between their values R v and R d is defined as the relation of relation difference, the value of relation value R i :

Ri=Rv-Rd R i =R v -R d

3-2)、两个角度关系Ev和Ed的值Rv和Rd的差被定义为角度关系差的关系,关系值Ri的取值范围为[0,π]3-2), the difference between the values R v and R d of two angular relationships E v and E d is defined as the relationship between the difference in angular relationship, and the value range of the relationship value R i is [0, π]

Figure BDA0002067313830000121
Figure BDA0002067313830000121

Figure BDA0002067313830000122
Figure BDA0002067313830000122

3-3)、两个关系Ev和Ed的值Rv和Rd的商被定义为关系商的关系值Ri3-3), the quotient of the values R v and R d of two relations E v and E d is defined as the relation value R i of the relation quotient:

Ri=Rv/Rd R i =R v /R d

图3为一个图案的关系图向量的有向图,图案中元素与元素之间存在距离差异的关系即第一种元素的关系类型;距离之间的差值关系即第三种关系的关系类型。Figure 3 is a directed graph of the relationship graph vector of a pattern. The relationship between the elements in the pattern and the distance difference is the relationship type of the first element; the difference relationship between the distances is the relationship type of the third relationship. .

S2、在不同拓扑结构图案之间进行元素的匹配;S2. Matching elements between different topological patterns;

构建了基于如下能量方程的离散优化模型,用于在两个图案之间找对应的元素:A discrete optimization model based on the following energy equation was constructed to find corresponding elements between two patterns:

Figure BDA0002067313830000123
Figure BDA0002067313830000123

其中,m和n分别是进行元素匹配的图案a和图案b的元素个数,Xij是用于指定一个图案中的第i个元素是否与另外一个图案的第j个元素对应,i∈m,j∈n;Xij为1表示元素i和元素j存在对应关系,否则不存在;Vij用于指定当Xij为1时,该对应带来的消耗;元素与元素之间对应的消耗定义为两个元素之间的欧式距离;λ是权重,用于平衡离散优化模型中的前一项

Figure BDA0002067313830000124
与后一项
Figure BDA0002067313830000125
Among them, m and n are the number of elements of pattern a and pattern b for element matching respectively, X ij is used to specify whether the i-th element in a pattern corresponds to the j-th element of another pattern, i∈m , j∈n; X ij being 1 means that there is a corresponding relationship between element i and element j, otherwise it does not exist; V ij is used to specify the consumption caused by the correspondence when X ij is 1; the corresponding consumption between elements Defined as the Euclidean distance between two elements; λ is the weight used to balance the previous term in the discrete optimization model
Figure BDA0002067313830000124
with the latter
Figure BDA0002067313830000125

后一项用于避免一个图案中的两个对称的元素分别对应到其他图案中两个不对称的图案,因此,建立一个列表,列表中的每一项是一个四元素(p,q,g,h),其中p和g表示图案a中的第p和第q个元素是对称关系,q和h表示图案a中的第q和第h个元素是对称关系。设该列表的长度为K,则后一项中第k个列表计算式的Sk定义为:The latter item is used to avoid that two symmetrical elements in one pattern correspond to two asymmetrical patterns in other patterns respectively. Therefore, a list is established, and each item in the list is a four-element (p,q,g , h), where p and g indicate that the p-th and q-th elements in pattern a are in a symmetrical relationship, and q and h indicate that the q-th and h-th elements in pattern a are in a symmetrical relationship. Suppose the length of the list is K, then the S k of the kth list calculation formula in the latter item is defined as:

Figure BDA0002067313830000126
Figure BDA0002067313830000126

其中Xpg是用于指定图案a中的第p个元素是否与图案b中的第q个元素对应,Xqh是用于指定图案a中的第q个元素是否与图案b的第h个元素对应,

Figure BDA0002067313830000131
是异或操作;Among them, X p , g are used to specify whether the pth element in pattern a corresponds to the qth element in pattern b, and X q , h are used to specify whether the qth element in pattern a corresponds to the pattern b's The hth element corresponds to,
Figure BDA0002067313830000131
is an XOR operation;

同时该离散优化模型需要满足如下的三个约束条件,

Figure BDA0002067313830000132
表示图案a中的每一个元素至少要与图案b中的一个元素存在对应关系;
Figure BDA0002067313830000133
则表示图案b中的每一个元素也至少要与图案a中的一个元素存在对应关系;
Figure BDA0002067313830000134
则表示当图案a中的第i个元素与图案b中的第j个元素产生对应关系后,如果图案a中的第i个元素与图案b中的不是第j个元素的其他元素产生对应,则图案b中的第j个元素不能再与图案a中不是的第i个元素的其他元素产生对应;同样如果图案b中的第j个元素与图案a中的不是第i个元素的其他元素产生对应,则图案a中的第i个元素不能再与图案b中不是的第j个元素的其他元素产生对应。At the same time, the discrete optimization model needs to meet the following three constraints:
Figure BDA0002067313830000132
Indicates that each element in pattern a must have a corresponding relationship with at least one element in pattern b;
Figure BDA0002067313830000133
Then it means that each element in the pattern b also has a corresponding relationship with at least one element in the pattern a;
Figure BDA0002067313830000134
It means that when the i-th element in pattern a corresponds to the j-th element in pattern b, if the i-th element in pattern a corresponds to other elements in pattern b that are not the j-th element, Then the j-th element in pattern b can no longer correspond to other elements in pattern a that are not the i-th element; similarly, if the j-th element in pattern b matches other elements in pattern a that are not the i-th element Correspondingly, the i-th element in pattern a can no longer correspond to other elements in pattern b that are not the j-th element.

图4是本实施例中需要进行元素配对的两个图案,图5是通过离散优化模型对图4两个图案的元素进行元素配对的结果,图中图案中的每一个元素都带有标签,左右两个图案中标签相同的元素存在对应关系,根据两个图案中元素的位置关系,离散优化模型允许一个图案中的一个点会对应另一个图案上的多个点。在图4中,其中左边图案内圈上的一个点会对应右边图案内圈上的两个点。Fig. 4 is two patterns that need to carry out element pairing in the present embodiment, and Fig. 5 is the result that element pairing is carried out to the element of Fig. 4 two patterns by discrete optimization model, each element in the pattern in the figure has label, There is a corresponding relationship between the elements with the same label in the left and right patterns. According to the positional relationship of the elements in the two patterns, the discrete optimization model allows one point in one pattern to correspond to multiple points in the other pattern. In Figure 4, one point on the inner circle of the pattern on the left corresponds to two points on the inner circle of the pattern on the right.

S3、基于RJMCMC算法在不同拓扑结构图案之间采样,得到新的图案;S3, based on the RJMCMC algorithm, sampling between different topological patterns to obtain new patterns;

在两个图案之间构建了如下能量函数用于度量新采样得到的图案的好坏:The following energy function is constructed between the two patterns to measure the quality of the newly sampled pattern:

F(μ,μab)=||αFvalid(μ)||2+||βFconstrain(μ,μab)||2+||γFgroup(μ)||2+||δFlocal(μ,τ)||2 F(μ,μ ab )=||αF valid (μ)|| 2 +||βF c o nstrain (μ,μ ab )|| 2 +||γF gr o up (μ) || 2 +||δF l o cal (μ,τ)|| 2

s.t.μ{Rca}=μa{Rca}andμ{Rcb}=μb{Rcb} (4)stμ{R ca }=μ a {R ca }andμ{R cb }=μ b {R cb } (4)

其中,μ是新的图案中元素的关系图向量,μa和μb分别是给定的两个图案中元素的关系图向量。α是能量函数中第一项的权重;能量函数中第一项Fvalid(μ)定义为:Among them, μ is the relationship diagram vector of the elements in the new pattern, and μ a and μ b are the relationship diagram vectors of the elements in the given two patterns respectively. α is the weight of the first term in the energy function; the first term F valid (μ) in the energy function is defined as:

Fvalid(μ)=μ-σ(μ) (5)F valid (μ)=μ-σ(μ) (5)

其中σ(μ)是关系图向量中的元素与其关系的实际值所组成的新的向量Where σ(μ) is a new vector composed of the elements in the relationship diagram vector and the actual value of their relationship

Figure BDA0002067313830000135
Figure BDA0002067313830000135

其中σi(μ)代表σ(μ)向量中的第i项,μi代表μ向量中的第i项,如果μ中的第i项是图案中一个元素的信息,则σ(μ)中的第i项保持μ中的第i项的值依旧表示图案中该元素的相同信息;如果μ中的第i项是图案中一个元素与元素之间的关系的值,σ(μ)中的第i项则是该关系实际的值;

Figure BDA0002067313830000141
则是从节点Ni所代表的元素的若干个信息中获取到计算所需要的位置信息、方向信息或者角度信息,则
Figure BDA0002067313830000142
表示根据节点Ni所代表的关系类型利用其相关的两个输入节点Ni1和Ni2所包含的相应的元素信息计算出该关系的实际值;如果μ中的第i项是关系图向量中一个关系与关系之间的关系值,σ(μ)中的第i项同样是该关系的实际值,则
Figure BDA0002067313830000143
表示根据节点Ni所代表的关系类型利用其相关的两个输入节点Ni1和Ni2所包含的关系值计算出该关系的实际值;Where σ i (μ) represents the i-th item in the σ(μ) vector, and μ i represents the i-th item in the μ vector, if the i-th item in μ is the information of an element in the pattern, then in σ(μ) The i-th item in μ keeps the value of the i-th item in μ still representing the same information of the element in the pattern; if the i-th item in μ is the value of the relationship between an element and an element in the pattern, the value of the i-th item in σ(μ) The i item is the actual value of the relationship;
Figure BDA0002067313830000141
It is to obtain the position information, direction information or angle information required for the calculation from several pieces of information of the elements represented by the node N i , then
Figure BDA0002067313830000142
Indicates that according to the relationship type represented by node N i , the actual value of the relationship is calculated by using the corresponding element information contained in the two related input nodes N i1 and N i2 ; if the i-th item in μ is in the relationship graph vector The relationship value between a relationship and the relationship, the i-th item in σ(μ) is also the actual value of the relationship, then
Figure BDA0002067313830000143
Indicates that according to the relationship type represented by node N i , the actual value of the relationship is calculated by using the relationship values contained in the two related input nodes N i1 and N i2 ;

β是能量函数中第二项的权重,用户约束采样得到的新图案中的一些元素是保持给定的图案a和图案b中的一些元素的位置、大小和方向,因此Fconstrain(μ,μab)定义为衡量新图案的关系图向量中受到约束的元素的信息与其指定的图案中的元素的信息之间的差距:β is the weight of the second item in the energy function. Some elements in the new pattern obtained by user constraint sampling are to maintain the position, size and direction of some elements in the given pattern a and pattern b, so F constrain (μ,μ a , μ b ) is defined as the measure of the gap between the information of the constrained elements in the graph vector of the new pattern and the information of the elements in the specified pattern:

Fconstrain(μ,μab)=μ{Eca}-μa{E'ca}+μ{Ecb}-μb{E'cb} (11)F constrain (μ,μ ab )=μ{E ca }-μ a {E' ca }+μ{E cb }-μ b {E' cb } (11)

其中Eca表示新图案中受到约束需要保持图案a中的元素信息的元素集合,E'ca表示Eca中的元素需要保持的图案a中的元素集合;Ecb表示新图案中受到约束需要保持图案b中的元素信息的元素集合,E'cb表示Ecb中的元素需要保持的图案b中的元素集合;μ{Eca}表示Eca集合中的元素在新图案的关系图向量μ中的元素信息;μa{E'ca}表示E'ca集合中的元素在图案a的关系图向量μa中的元素信息;μb{E'cb}表示E'cb集合中的元素在图案b的关系图向量μb中的元素信息;Where E ca represents the set of elements in the new pattern that are constrained to keep the element information in pattern a, E' ca represents the set of elements in pattern a that the elements in E ca need to maintain; E cb represents the set of elements in the new pattern that are constrained and need to maintain The element set of element information in pattern b, E' cb means the element set in pattern b that the elements in E cb need to keep; μ{E ca } means that the elements in the E ca set are in the relationship graph vector μ of the new pattern μ a {E' ca } means the element information of the elements in the E' ca set in the pattern a vector μ a ; μ b {E' cb } means the elements in the E' cb set are in the pattern The element information in the relationship diagram vector μ b of b;

γ是能量函数中第三项的权重,Fgroup(μ)定义为衡量对称关系组与其平均值之间的差距:γ is the weight of the third term in the energy function, and F group (μ) is defined to measure the distance between the symmetric relation group and its mean value:

Figure BDA0002067313830000144
Figure BDA0002067313830000144

Fgroup(μ)是由关系图向量μ中所有对称关系组与其平均值之间的差距所组成的一维向量,图案中的元素对称性在关系图向量中表现为关系值,G表示对称关系组的关系值相等的集合,设新生成的图案中有H个关系值相等的集合,μ{Gh}表示第h个集合中的关系在关系图向量中的值所组成的向量,H=1~h,

Figure BDA0002067313830000145
表示第h个集合中所有关系值的平均值。F group (μ) is a one-dimensional vector composed of the gap between all symmetric relationship groups in the relationship graph vector μ and their average value. The symmetry of elements in the pattern is expressed as the relationship value in the relationship graph vector, and G indicates the symmetric relationship Sets with equal relationship values in the group, assuming that there are H sets with equal relationship values in the newly generated pattern, μ{G h } represents the vector composed of the values of the relationship in the hth set in the relationship graph vector, H= 1~h,
Figure BDA0002067313830000145
Denotes the average of all relation values in the hth set.

δ是能量函数中第四项的权重,从给定的图案a和图案b中随机选择一个图案作为新图案的指导图案,该指导图案的关系图向量表示为τ,因此Flocal(μ,τ)定义为衡量新图案与指导图案之间的差距:δ is the weight of the fourth item in the energy function, randomly select a pattern from the given pattern a and pattern b as the guiding pattern of the new pattern, and the relationship graph vector of the guiding pattern is expressed as τ, so F local (μ,τ ) is defined as a measure of the gap between the new pattern and the guide pattern:

Flocal(μ,τ)=μ-τ (13)F local (μ,τ)=μ-τ (13)

最终,从能量方程来说一个最好的图案满足:图案中的关系的实际值与图案对应的关系向量图μ中的关系值相等;图案对应的关系向量图μ中的关系值与其所在的对称关系组中关系值的平均值相等;图案中受到约束的元素的信息与需要保持的元素的信息相等;图案对应的关系向量图μ与指导关系向量图τ相等;Finally, from the energy equation, a best pattern satisfies: the actual value of the relationship in the pattern is equal to the relationship value in the relationship vector diagram μ corresponding to the pattern; the relationship value in the relationship vector diagram μ corresponding to the pattern is symmetrical to its location The average value of the relationship value in the relationship group is equal; the information of the constrained elements in the pattern is equal to the information of the elements that need to be kept; the relationship vector graph μ corresponding to the pattern is equal to the guiding relationship vector graph τ;

进一步的,采用RJMCMC采样算法在不同拓扑结构的图案之间获得大量的既能保持多个源图案中的局部特征的同时也能有一些额外变化的新图案;RJMCMC算法维持一个随机变量的维度可变的马尔科夫链,该马尔科夫链中不断生成的随机变量在运行过程中逐渐趋近于一个固定的概率分布p直至完全稳定。接下来从该马尔科夫链中采样得到的所有的随机变量均满足这个固定的概率分布。因此RJMCMC算法设定这样一个概率密度函数:Further, the RJMCMC sampling algorithm is used to obtain a large number of new patterns that can not only maintain the local characteristics in multiple source patterns but also have some additional changes between patterns of different topological structures; the RJMCMC algorithm maintains a random variable The dimension can be A variable Markov chain, in which the continuously generated random variable gradually approaches a fixed probability distribution p until it is completely stable. Then all the random variables sampled from the Markov chain satisfy this fixed probability distribution. Therefore, the RJMCMC algorithm sets such a probability density function:

Figure BDA0002067313830000151
Figure BDA0002067313830000151

其中F是能量函数:where F is the energy function:

F=F(μ,μab) (11)F=F(μ,μ ab ) (11)

关系图向量μ的概率密度函数可以表示为The probability density function of the graph vector μ can be expressed as

Figure BDA0002067313830000152
Figure BDA0002067313830000152

Z是使分布归一化的配分函数,通常较为复杂,但RJMCMC算法可以在不需要计算配分函数的情况下进行采样。β是一个温度系数。根据RJMCMC算法计算的能量方程的不同,β的值由人为的设定而来。Z is the partition function that normalizes the distribution, usually complex, but the RJMCMC algorithm can sample without computing the partition function. β is a temperature coefficient. According to the energy equation calculated by the RJMCMC algorithm, the value of β is artificially set.

将图案a的关系图向量μa和图案b的关系图向量μb输入RJMCMC算法,μa∈μ,μb∈μ,μa将作为马尔科夫链的初始变量以x0表示,马尔科夫链得到的每一个变量xi代表一个关系图向量μi;RJMCMC算法在每次迭代得到马尔科夫链的新变量的过程中,首先会随机选择漫移操作或者跳跃操作中的其中一种操作。Input the relationship graph vector μ a of pattern a and the relationship graph vector μ b of pattern b into the RJMCMC algorithm, μ a ∈ μ, μ b ∈ μ, μ a will be represented by x 0 as the initial variable of the Markov chain, Marko Each variable x i obtained by the Markov chain represents a relational graph vector μ i ; in the process of obtaining new variables of the Markov chain in each iteration of the RJMCMC algorithm, it first randomly selects one of the roaming operations or jumping operations operate.

马尔科夫链得到的每一个变量ei代表一个关系图向量μi也代表着一个新的图案;Each variable e i obtained by the Markov chain represents a relationship graph vector μ i also represents a new pattern;

RJMCMC算法在每次迭代得到马尔科夫链的新变量的过程中,首先会随机选择漫移操作或者跳跃操作中的其中一种操作;如果得到马尔科夫链中第m个变量em的第m次迭代选择了漫移操作,则马尔科夫链的新变量em将通过在上一个变量em-1中代表的关系图向量μ的任意一项μi上加上一个从正态分布

Figure BDA0002067313830000153
中采样的偏移量得到。该正态分布
Figure BDA0002067313830000154
将由人为指定。In the process of obtaining new variables of the Markov chain in each iteration of the RJMCMC algorithm, it first randomly selects one of the roaming operations or jump operations; if the mth variable e m in the Markov chain is obtained The m iterations select the roaming operation, then the new variable e m of the Markov chain will add a value from the normal distribution to any item μ i of the relationship graph vector μ represented by the previous variable em -1
Figure BDA0002067313830000153
The offset of the sample in is obtained. The normal distribution
Figure BDA0002067313830000154
will be specified manually.

如果得到马尔科夫链中第i个变量xi的第i次迭代选择了跳跃操作,则马尔科夫链的新变量xi的候选变量xi'将通过在上一个变量xi-1中随机增加或者减少向量的维度得到,具体的,在变量xi-1代表的关系图向量μi-1中根据步骤S2中计算的元素的对应关系随机选择一组元素的对应关系,并将新的元素加入该对应关系中缺少新元素的图案,新的元素的四个信息随机生成。同时产生新的元素与关系图向量μi-1所对应的图案中的元素之间的关系,或者减去多出的元素,同时消去多出的元素与关系图向量μi-1所对应的图案中的元素关系,形成新的关系图向量μiIf the i-th iteration of the i-th variable x i in the Markov chain chooses the jump operation, the candidate variable x i ' of the new variable x i of the Markov chain will be passed in the previous variable x i-1 Randomly increase or decrease the dimension of the vector to obtain, specifically, in the relationship graph vector μ i- 1 represented by the variable x i-1 , randomly select a group of corresponding relationships of elements according to the corresponding relationship of elements calculated in step S2, and put the new The elements added to the pattern lacking new elements in the corresponding relationship, the four information of the new elements are randomly generated. At the same time, the relationship between the new elements and the elements in the pattern corresponding to the relationship diagram vector μ i-1 is generated, or the excess elements are subtracted, and the relationship between the excess elements and the relationship diagram vector μ i-1 is eliminated at the same time The element relationship in the pattern forms a new relationship graph vector μ i ;

RJMCMC算法根据如下接受拒绝概率来选择是否接受候选变量xi'成为新变量xiThe RJMCMC algorithm chooses whether to accept the candidate variable x i ' as a new variable x i according to the acceptance and rejection probability as follows:

Figure BDA0002067313830000161
Figure BDA0002067313830000161

Figure BDA0002067313830000162
Figure BDA0002067313830000162

其中

Figure BDA0002067313830000163
表示接受xi+1作为马尔科夫链中新变量的概率,取值[0,1],如果本次迭代选择漫移操作,则拒绝接受概率选择公式(6),其中p(μi+1)是使用关系图向量μi+1计算得到的概率密度;p(μi)是使用关系图向量μi计算得到的概率密度;如果本次迭代选择跳跃操作,则拒绝接受概率选择公式(7),其中q(μii+1)是从关系图向量μi+1通过增减向量的维度得到关系图向量μi的概率;q(μi+1i)是从关系图向量μi通过增减向量的维度得到关系图向量μi+1的概率;然后RJMCMC算法从一个0-1分布中随机采样一个数字t;如果数字t小于
Figure BDA0002067313830000164
则RJMCMC算法接受xi+1作为马尔科夫链中新变量;如果数字t大于
Figure BDA0002067313830000165
则RJMCMC算法不接受xi+1作为马尔科夫链中新变量,保持xi作为马尔科夫链中新变量。in
Figure BDA0002067313830000163
Indicates the probability of accepting x i+1 as a new variable in the Markov chain, and takes the value [0,1]. If the roaming operation is selected for this iteration, the probability selection formula (6) is rejected, where p(μ i+ 1 ) is the probability density calculated by using the relationship graph vector μ i+1 ; p(μ i ) is the probability density calculated by using the relationship graph vector μ i ; if the jump operation is selected for this iteration, the probability selection formula ( 7), where q(μ ii+1 ) is the probability of obtaining the relationship graph vector μ i from the relationship graph vector μ i+1 by increasing or decreasing the dimension of the vector; q(μ i+1i ) is obtained from The relationship graph vector μ i obtains the probability of the relationship graph vector μ i+1 by increasing or decreasing the dimension of the vector; then the RJMCMC algorithm randomly samples a number t from a 0-1 distribution; if the number t is less than
Figure BDA0002067313830000164
Then the RJMCMC algorithm accepts x i+1 as a new variable in the Markov chain; if the number t is greater than
Figure BDA0002067313830000165
Then the RJMCMC algorithm does not accept xi+1 as a new variable in the Markov chain, and keeps xi as a new variable in the Markov chain.

经过一段时间的迭代后,RJMCMC算法中马尔科夫链的随机变量根据式(5)计算得到的值出现的次数概率将等于这个计算得到的值,这些变量将作为RJMCMC算法采样得到的结果。After a period of iterations, the probability of occurrences of the random variables of the Markov chain in the RJMCMC algorithm calculated according to formula (5) will be equal to the calculated value, and these variables will be used as the sampling results of the RJMCMC algorithm.

RJMCMC算法在迭代的过程中经过跳转操作

Figure BDA0002067313830000166
得到变量维度为n的X′1,RJMCMC算法经过漫移操作相继得到X′2、X′3、X′4,接下来跳转操作
Figure BDA0002067313830000167
得到了变量维度为m的X′5.RJMCMC算法再经过漫移操作相继得到变量X′6、X′7、X′8,接下来采取跳转操作
Figure BDA0002067313830000168
得到另外维度的变量。这些变量将作为RJMCMC算法采样得到的结果。图6和图7分别是图4中的两个图案进行RJMCMC算法得到的两个新图案,分别为图案X3′和图案X7′。The RJMCMC algorithm undergoes a jump operation during the iterative process
Figure BDA0002067313830000166
Obtain X′ 1 with a variable dimension of n, the RJMCMC algorithm obtains X′ 2 , X′ 3 , and X′ 4 successively through the roaming operation, and then jumps
Figure BDA0002067313830000167
Obtained X′ 5 with a variable dimension of m. The RJMCMC algorithm obtains the variables X′ 6 , X′ 7 , and X′ 8 successively through the roaming operation, and then takes the jump operation
Figure BDA0002067313830000168
Get the variable of another dimension. These variables will be taken as the results of RJMCMC algorithm sampling. Fig. 6 and Fig. 7 are respectively two new patterns obtained by performing the RJMCMC algorithm on the two patterns in Fig. 4, which are pattern X3' and pattern X7' respectively.

如图所示,图中圆的半径线代表了该元素的方向,图6和图7中图案内圈上的元素数量与图4中的给定的两个图案中内圈上的元素不同。As shown in the figure, the radius line of the circle in the figure represents the direction of the element, and the number of elements on the inner circle of the patterns in Figures 6 and 7 is different from the elements on the inner circle in the given two patterns in Figure 4 .

一种利用所述结构可变的图案生成浏览界面的方法,包括以下步骤:A method for generating a browsing interface using the pattern with variable structure, comprising the following steps:

1)、获取采样得到的新图案的高维向量表达特征;1), obtain the high-dimensional vector expression feature of the new pattern obtained by sampling;

由于通过RJMCMC算法采样得到的新图案都具有各自的关系图向量,因此新图案的高位向量表达特征可以直接采用该图案的关系图向量表示。Since the new patterns sampled by the RJMCMC algorithm have their own relationship graph vectors, the high-level vector expression features of the new patterns can be directly represented by the relationship graph vectors of the pattern.

2)、采用GPLVM(Gaussian Process Latent Variable Model高斯过程隐变量模型)将上述高维向量空间压缩到二维流形空间;2), using GPLVM (Gaussian Process Latent Variable Model Gaussian process latent variable model) to compress the above high-dimensional vector space into a two-dimensional manifold space;

使用了高斯过程隐变量模型工具箱进行空间的降维。该工具可以直接将新图案的高维向量表达特征压缩降维成一个二维向量进行表示。所有的二维向量作为坐标确定了一个采样结果的高维向量空间的二维流形。同时工具箱还会计算该高维向量空间中所有的图案与采样结果的协方差值,协方差值越大,二维流形上展示的颜色越红;协方差值越小,二维流形上展示的颜色越蓝,最终形成一张二维流形热图。Gaussian Process Hidden Variable Model Toolbox was used for spatial dimensionality reduction. This tool can directly compress and reduce the high-dimensional vector expression features of new patterns into a two-dimensional vector for representation. All two-dimensional vectors as coordinates define a two-dimensional manifold of the high-dimensional vector space of the sampling results. At the same time, the toolbox will also calculate the covariance value of all patterns and sampling results in the high-dimensional vector space. The larger the covariance value, the redder the color displayed on the two-dimensional manifold; the smaller the covariance value, the two The bluer the color displayed on the two-dimensional manifold, the final form is a two-dimensional manifold heat map.

3)、将二维流形空间中的点逆映射到高维空间中,得到新的图案,并对其进行后处理;3) Inversely map the points in the two-dimensional manifold space to the high-dimensional space to obtain a new pattern, and perform post-processing on it;

构建了如下的图案修复函数进行后处理,用于修复图案中存在的对称关系The following pattern repair function is constructed for post-processing to repair the symmetry relationship existing in the pattern

Figure BDA0002067313830000171
Figure BDA0002067313830000171

其中μ是修复函数的变量,μ0是需要通过此函数进行修复的图案的关系图向量。where μ is the variable of the inpainting function, and μ0 is the graph vector of patterns that need to be inpainted by this function.

S7、生成图案浏览界面:所述的图案浏览界面分为两个部分,一部分是得到的二维流形热图,用户通过鼠标在二维流形热图上滑动,另一部分会出现相应的新图案。S7. Generate a pattern browsing interface: the pattern browsing interface is divided into two parts, one part is the obtained two-dimensional manifold heat map, the user slides the mouse on the two-dimensional manifold heat map, and the other part will appear corresponding new pattern.

如图8所示,左边显示二维流形的热量图,右边显示对应的高维空间的新图案;As shown in Figure 8, the heat map of the two-dimensional manifold is shown on the left, and the new pattern of the corresponding high-dimensional space is shown on the right;

用户的浏览方法如下:用户在界面左边的二维流形热量图中滑动鼠标,界面右边出现相应的图案。如图8所示,界面中左边显示二维流形热量图,当用户在图上随意拖动鼠标,界面中右边将会出现相应的图案。The user's browsing method is as follows: the user slides the mouse on the two-dimensional manifold heat map on the left side of the interface, and the corresponding pattern appears on the right side of the interface. As shown in Figure 8, the two-dimensional manifold heat map is displayed on the left side of the interface. When the user drags the mouse on the map at will, the corresponding pattern will appear on the right side of the interface.

以上对本发明实施例所提供的技术方案进行了详细介绍,本发明中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The technical solutions provided by the embodiments of the present invention have been described in detail above. In the present invention, specific examples have been used to illustrate the principles and implementation modes of the present invention. The descriptions of the above embodiments are only used to help understand the methods and methods of the present invention. core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be construed as limiting the present invention .

Claims (8)

1.一种结构可变的图案生成方法,其特征在于,包括以下步骤:1. A method for generating patterns with variable structure, comprising the following steps: S1、为图案中的元素构建关系图模型;构建的关系图模型是用来描述图案中的元素间的关系以及关系间的关系;S1. Construct a relationship diagram model for the elements in the pattern; the constructed relationship diagram model is used to describe the relationship between the elements in the pattern and the relationship between the relationships; 关系图模型包括关系图向量,其中,一个关系图向量代表一个图案;所述关系图向量是一个一维向量,主要由三个部分组成,其中第一个部分依次是图案中每个元素的位置(xi,yi)、朝向θi和尺寸si这三个信息,第二个部分包含元素与元素之间关系的值,第三个部分是关系值r,所述关系值r包括元素与元素的关系值和关系的关系值,关系图向量μ如下:The relationship diagram model includes a relationship diagram vector, wherein a relationship diagram vector represents a pattern; the relationship diagram vector is a one-dimensional vector mainly composed of three parts, wherein the first part is the position of each element in the pattern in turn (x i , y i ), orientation θ i and size s i , the second part contains the value of the relationship between elements, the third part is the relationship value r, and the relationship value r includes the element The relationship value with the element and the relationship value of the relationship, the relationship graph vector μ is as follows: μ=(x1,y11,s1,x2,y22,s2,...,xi,yii,si,r1,r2,r3,...,ri) (1)μ=(x 1 ,y 11 ,s 1 ,x 2 ,y 22 ,s 2 ,..., xi ,y ii ,s i ,r 1 ,r 2 ,r 3 ,...,r i ) (1) 关系图模型通过有向图
Figure FDA0003857553580000011
进行表示,有向图的节点N=E∪R,其中E是图案中元素的集合,第i个元素表示为Ei=(xi,yii,si),Ei∈E,i表示元素的数量;R是图案中关系的集合,R=RE∪RR,RE是元素关系集合,RR是关系间的关系集合,每一个关系有相应的关系值,其中第i个关系的关系值表示为Ri=(ri),Ri∈R;有向图的边A={(Ni1,Ri),(Ni2,Ri)}i=1...k+l,其中k是关系图模型中元素关系的数量,l是关系的关系数量;将节点Ni对应关系图向量的所有的元素信息或关系值记做
Figure FDA0003857553580000012
Figure FDA0003857553580000013
if Ni=Ej∈E以及
Figure FDA0003857553580000014
if Ni=Rj∈R,其中Ej∈E;
Relational graph models through directed graphs
Figure FDA0003857553580000011
For representation, the node N=E∪R of the directed graph, where E is the set of elements in the pattern, and the i-th element is expressed as E i =( xi ,y ii ,s i ), E i ∈ E , i represents the number of elements; R is the set of relations in the pattern, R=RE ∪R R , R E is the set of element relations, R R is the set of relations between relations, and each relation has a corresponding relation value, among which The relationship value of i relationship is expressed as R i =(ri ),R i ∈R; the edge A of the directed graph={(N i1 ,R i ),(N i2 ,R i )} i=1.. .k+l , where k is the number of element relationships in the relationship graph model, and l is the number of relationships in the relationship; record all the element information or relationship values of the node N i corresponding to the relationship graph vector as
Figure FDA0003857553580000012
Figure FDA0003857553580000013
if N i =E j ∈ E and
Figure FDA0003857553580000014
if N i = R j ∈ R, where E j ∈ E;
具体地,元素的关系类型共有6种,关系的关系类型有3种,其中,6种元素的关系类型为:Specifically, there are 6 relationship types of elements and 3 relationship types of relationships, among which, the relationship types of 6 elements are: 1)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心的距离被定义为元素之间的欧几里德距离关系,其中关系值Ri的值为:1), the distance between an element E a in the representative pattern and the center of another element E b in the representative pattern is defined as the Euclidean distance relationship between the elements, wherein the value of the relationship value R i is:
Figure FDA0003857553580000015
Figure FDA0003857553580000015
其中,(xa,ya)为元素Ea的位置,(xa,yb)为元素Eb的位置;Wherein, (x a , y a ) is the position of element E a , (x a , y b ) is the position of element E b ; 2)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的方向之间的角度差被定义为元素之间的方向差关系,关系值Ri的取值范围为[-π,π],顺时针的角度变化为负数:2), the angle difference between an element E a in the representative pattern and the direction of another element E b in the representative pattern is defined as the direction difference relationship between the elements, and the value range of the relation value R i is [- π,π], clockwise angle changes are negative:
Figure FDA0003857553580000016
Figure FDA0003857553580000016
Figure FDA0003857553580000017
Figure FDA0003857553580000017
其中,θa和θb分别为Ea和Eb的朝向;Among them, θ a and θ b are the orientations of E a and E b respectively; 3)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的大小之间的差被定义为元素之间的大小差关系,关系值Ri3), the difference between the size of an element E a in the representative pattern and the size of another element E b in the representative pattern is defined as the size difference relationship between the elements, the relationship value R i : Ri=sa-sb R i =s a -s b 其中,sa 和sb 分别为Ea和Eb的尺寸;Among them, s a and s b are the dimensions of E a and E b respectively; 4)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心点之间的连线与X轴之间的夹角被定义为绝对角度差关系,关系值Ri的取值范围为[-π,π],顺时针的角度变化为负数:4), the angle between the connection line between an element E a in the representative pattern and the central point of another element E b in the representative pattern and the X axis is defined as the absolute angle difference relationship, and the relationship value R i The value range is [-π,π], and the clockwise angle change is negative:
Figure FDA0003857553580000021
Figure FDA0003857553580000021
Figure FDA0003857553580000022
Figure FDA0003857553580000022
5)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心点之间的连线与元素Ea的方向之间的夹角被定义为元素之间的相对角度差关系,关系值Ri的取值范围为[-π,π],顺时针的角度变化为负数:5), the angle between the line between an element E a in the representative pattern and the center point of another element E b in the representative pattern and the direction of the element E a is defined as the relative angle difference between the elements Relationship, the value range of the relationship value R i is [-π, π], and the clockwise angle change is a negative number:
Figure FDA0003857553580000023
Figure FDA0003857553580000023
Figure FDA0003857553580000024
Figure FDA0003857553580000024
6)、代表图案中的一个元素Ea和代表图案中的另一个元素Eb的中心点之间的连线与元素Ea的方向之间的夹角的绝对值被定义为元素之间的对称角度差关系,关系值Ri的取值范围为[0,π],顺时针和逆时针的角度变化均为正数:6), the absolute value of the angle between the line between an element E a in the representative pattern and the center point of another element E b in the representative pattern and the direction of the element E a is defined as the angle between the elements Symmetric angle difference relationship, the value range of the relationship value R i is [0, π], and the angle changes of clockwise and counterclockwise are both positive numbers:
Figure FDA0003857553580000025
Figure FDA0003857553580000025
所述3种关系的关系类型分别为:The relationship types of the three relationships are: 3-1)、两个不是角度关系的关系Ev和Ed,其值Rv和Rd的差被定义为关系差的关系,关系值Ri的取值:3-1), two relations E v and E d that are not angular relations, the difference between their values R v and R d is defined as the relation of relation difference, the value of relation value R i : Ri=Rv-Rd R i =R v -R d 3-2)、两个角度关系Ev和Ed的值Rv和Rd的差被定义为角度关系差的关系,关系值Ri的取值范围为[0,π]3-2), the difference between the values R v and R d of two angular relationships E v and E d is defined as the relationship between the difference in angular relationship, and the value range of the relationship value R i is [0, π]
Figure FDA0003857553580000026
Figure FDA0003857553580000026
Figure FDA0003857553580000027
Figure FDA0003857553580000027
3-3)、两个关系Ev和Ed的值Rv和Rd的商被定义为关系商的关系值Ri3-3), the quotient of the values R v and R d of two relations E v and E d is defined as the relation value R i of the relation quotient: Ri=Rv/RdR i =R v /R d ; S2、采用能量方程的离散优化模型,在不同拓扑结构图案之间进行元素的匹配;S2. Using a discrete optimization model of the energy equation to match elements between different topological patterns; S3、基于RJMCMC算法,在不同拓扑结构图案之间采样,获得新的图案。S3. Based on the RJMCMC algorithm, sampling between patterns of different topological structures to obtain new patterns.
2.根据权利要求1所述的一种结构可变的图案生成方法,其特征在于:步骤S2所述的基于能量方程的离散优化模型如下:2. A kind of pattern generation method with variable structure according to claim 1, characterized in that: the discrete optimization model based on energy equation described in step S2 is as follows:
Figure FDA0003857553580000031
Figure FDA0003857553580000031
使得
Figure FDA0003857553580000032
make
Figure FDA0003857553580000032
其中,m和n分别是进行元素匹配的图案a和图案b的元素个数,Xij是用于指定一个图案中的第i个元素是否与另外一个图案的第j个元素对应,i∈m,j∈n;Xij为1表示元素i和元素j存在对应关系,否则不存在;Vij用于指定当Xij为1时,该对应带来的消耗;元素与元素之间对应的消耗定义为两个元素之间的欧式距离;λ是权重,用于平衡离散优化模型中的前一项
Figure FDA0003857553580000033
与后一项
Figure FDA0003857553580000034
Among them, m and n are the number of elements of pattern a and pattern b for element matching respectively, X ij is used to specify whether the i-th element in a pattern corresponds to the j-th element of another pattern, i∈m , j∈n; X ij being 1 means that there is a corresponding relationship between element i and element j, otherwise it does not exist; V ij is used to specify the consumption caused by the correspondence when X ij is 1; the corresponding consumption between elements Defined as the Euclidean distance between two elements; λ is the weight used to balance the previous term in the discrete optimization model
Figure FDA0003857553580000033
with the latter
Figure FDA0003857553580000034
后一项用于避免一个图案中的两个对称的元素分别对应到其他图案中两个不对称的图案,因此,建立一个列表,列表中的每一项是一个四元素(p,q,g,h),其中p和g表示图案a中的第p和第q个元素是对称关系,q和h表示图案a中的第q和第h个元素是对称关系;设该列表的长度为K,则后一项中第k个列表计算式的Sk定义为:The latter item is used to avoid that two symmetrical elements in one pattern correspond to two asymmetrical patterns in other patterns respectively. Therefore, a list is established, and each item in the list is a four-element (p,q,g , h), where p and g indicate that the pth and qth elements in pattern a are in a symmetrical relationship, and q and h indicate that the qth and hth elements in pattern a are in a symmetrical relationship; let the length of the list be K , then the S k of the kth list calculation formula in the latter item is defined as:
Figure FDA0003857553580000035
Figure FDA0003857553580000035
其中Xp,g是用于指定图案a中的第p个元素是否与图案b中的第q个元素对应,Xq,h是用于指定图案a中的第q个元素是否与图案b的第h个元素对应,
Figure FDA0003857553580000036
是异或操作;
Where X p, g is used to specify whether the p-th element in pattern a corresponds to the q-th element in pattern b, and X q, h is used to specify whether the q-th element in pattern a corresponds to the q-th element in pattern b The hth element corresponds to,
Figure FDA0003857553580000036
is an XOR operation;
同时该离散优化模型需要满足如下的三个约束条件,
Figure FDA0003857553580000037
表示图案a中的每一个元素至少要与图案b中的一个元素存在对应关系;
Figure FDA0003857553580000038
则表示图案b中的每一个元素也至少要与图案a中的一个元素存在对应关系;
Figure FDA0003857553580000039
则表示当图案a中的第i个元素与图案b中的第j个元素产生对应关系后,如果图案a中的第i个元素与图案b中的不是第j个元素的其他元素产生对应,则图案b中的第j个元素不能再与图案a中不是的第i个元素的其他元素产生对应;同样如果图案b中的第j个元素与图案a中的不是第i个元素的其他元素产生对应,则图案a中的第i个元素不能再与图案b中不是的第j个元素的其他元素产生对应。
At the same time, the discrete optimization model needs to meet the following three constraints:
Figure FDA0003857553580000037
Indicates that each element in pattern a must have a corresponding relationship with at least one element in pattern b;
Figure FDA0003857553580000038
Then it means that each element in the pattern b also has a corresponding relationship with at least one element in the pattern a;
Figure FDA0003857553580000039
It means that when the i-th element in pattern a corresponds to the j-th element in pattern b, if the i-th element in pattern a corresponds to other elements in pattern b that are not the j-th element, Then the j-th element in pattern b can no longer correspond to other elements in pattern a that are not the i-th element; similarly, if the j-th element in pattern b matches other elements in pattern a that are not the i-th element Correspondingly, the i-th element in pattern a can no longer correspond to other elements in pattern b that are not the j-th element.
3.根据权利要求1所述的一种结构可变的图案生成方法,其特征在于,步骤S3所述的RJMCMC算法如下:3. a kind of variable pattern generation method according to claim 1, is characterized in that, the RJMCMC algorithm described in step S3 is as follows: 设定概率密度函数:Specify the probability density function:
Figure FDA0003857553580000041
Figure FDA0003857553580000041
其中,p表示概率分布,Z是使分布归一化的配分函数,在RJMCMC算法不需要计算配分函数的情况下进行采样,F为能量函数;Among them, p represents the probability distribution, Z is the partition function that normalizes the distribution, sampling is performed when the RJMCMC algorithm does not need to calculate the partition function, and F is the energy function; F=F(μ,μab) (4)F=F(μ,μ ab ) (4) 关系图向量μ的概率密度函数表示为:The probability density function of the graph vector μ is expressed as:
Figure FDA0003857553580000042
Figure FDA0003857553580000042
其中,β为由人为设定的温度系数;Among them, β is the temperature coefficient set artificially; 采样过程具体为:将图案a的关系图向量μa和图案b的关系图向量μb输入RJMCMC算法,μa∈μ,μb∈μ,μa将作为马尔科夫链的初始变量以e0表示,马尔科夫链得到的每一个变量ei代表一个关系图向量μi即代表着一个新的图案;The specific sampling process is as follows: input the relationship graph vector μ a of pattern a and the relationship graph vector μ b of pattern b into the RJMCMC algorithm, μ a ∈ μ, μ b ∈ μ, μ a will be used as the initial variable of the Markov chain with e 0 means that each variable e i obtained by the Markov chain represents a relationship graph vector μ i represents a new pattern; RJMCMC算法在每次迭代得到马尔科夫链的新变量的过程中,首先会随机选择漫移操作或者跳跃操作中的其中一种操作;如果得到马尔科夫链中第m’个变量em'的第m次迭代选择了漫移操作,则马尔科夫链的新变量em'将通过在上一个变量em'-1中代表的关系图向量μ的任意一项μi上加上一个从正态分布
Figure FDA0003857553580000046
中采样的偏移量得到,该正态分布
Figure FDA0003857553580000047
将由人为指定;
In the process of obtaining new variables of the Markov chain in each iteration of the RJMCMC algorithm, it first randomly selects one of the roaming operations or jump operations; if the m'th variable e m' in the Markov chain is obtained The mth iteration chooses the roaming operation, then the new variable e m' of the Markov chain will add a from normal distribution
Figure FDA0003857553580000046
The offset of sampling in is obtained, the normal distribution
Figure FDA0003857553580000047
will be manually designated;
如果得到马尔科夫链中第i个变量xi的第i次迭代选择了跳跃操作,则马尔科夫链的新变量xi的候选变量xi'将通过在上一个变量xi-1中随机增加或者减少向量的维度得到,具体的,在变量xi-1代表的关系图向量μi-1中根据步骤S2中计算的元素的对应关系随机选择一组元素的对应关系,并将新的元素加入该对应关系中缺少新元素的图案,新的元素的四个信息随机生成,同时产生新的元素与关系图向量μi-1所对应的图案中的元素之间的关系,或者减去多出的元素,同时消去多出的元素与关系图向量μi-1所对应的图案中的元素关系,形成新的关系图向量μiIf the i-th iteration of the i-th variable x i in the Markov chain chooses the jump operation, the candidate variable x i ' of the new variable x i of the Markov chain will be passed in the previous variable x i-1 Randomly increase or decrease the dimension of the vector to obtain, specifically, in the relationship graph vector μ i- 1 represented by the variable x i-1 , randomly select a group of corresponding relationships of elements according to the corresponding relationship of elements calculated in step S2, and put the new The elements of the corresponding relationship are added to the patterns that lack new elements, and the four information of the new elements are randomly generated, and at the same time, the relationship between the new elements and the elements in the pattern corresponding to the relationship graph vector μ i-1 is generated, or subtracted Remove the extra elements, and at the same time eliminate the relationship between the extra elements and the elements in the pattern corresponding to the relationship diagram vector μ i-1 , to form a new relationship diagram vector μ i ; RJMCMC算法根据如下接受拒绝概率来选择是否接受候选变量xi'成为新变量xiThe RJMCMC algorithm chooses whether to accept the candidate variable x i ' as a new variable x i according to the acceptance and rejection probability as follows:
Figure FDA0003857553580000043
Figure FDA0003857553580000043
Figure FDA0003857553580000044
Figure FDA0003857553580000044
其中
Figure FDA0003857553580000045
表示接受xi+1作为马尔科夫链中新变量的概率,取值[0,1],如果本次迭代选择漫移操作,则拒绝接受概率选择公式(6),其中p(μi+1)是使用关系图向量μi+1计算得到的概率密度;p(μi)是使用关系图向量μi计算得到的概率密度;如果本次迭代选择跳跃操作,则拒绝接受概率选择公式(7),其中q(μii+1)是从关系图向量μi+1通过增减向量的维度得到关系图向量μi的概率;q(μi+1i)是从关系图向量μi通过增减向量的维度得到关系图向量μi+1的概率;然后RJMCMC算法从一个0-1分布中随机采样一个数字t;如果数字t小于
Figure FDA0003857553580000051
则RJMCMC算法接受xi+1作为马尔科夫链中新变量;如果数字t大于
Figure FDA0003857553580000052
则RJMCMC算法不接受xi+1作为马尔科夫链中新变量,保持xi作为马尔科夫链中新变量;
in
Figure FDA0003857553580000045
Indicates the probability of accepting x i+1 as a new variable in the Markov chain, and takes the value [0,1]. If the roaming operation is selected for this iteration, the probability selection formula (6) is rejected, where p(μ i+ 1 ) is the probability density calculated by using the relationship graph vector μ i+1 ; p(μ i ) is the probability density calculated by using the relationship graph vector μ i ; if the jump operation is selected for this iteration, the probability selection formula ( 7), where q(μ ii+1 ) is the probability of obtaining the relationship graph vector μ i from the relationship graph vector μ i+1 by increasing or decreasing the dimension of the vector; q(μ i+1i ) is obtained from The relationship graph vector μ i obtains the probability of the relationship graph vector μ i+1 by increasing or decreasing the dimension of the vector; then the RJMCMC algorithm randomly samples a number t from a 0-1 distribution; if the number t is less than
Figure FDA0003857553580000051
Then the RJMCMC algorithm accepts x i+1 as a new variable in the Markov chain; if the number t is greater than
Figure FDA0003857553580000052
Then the RJMCMC algorithm does not accept xi+1 as a new variable in the Markov chain, and keeps xi as a new variable in the Markov chain;
经过一段时间的迭代后,RJMCMC算法中马尔科夫链的随机变量根据式(5)计算得到的值出现的次数概率将等于这个计算得到的值,这些变量将作为RJMCMC算法采样得到的结果。After a period of iterations, the probability of occurrences of the random variables of the Markov chain in the RJMCMC algorithm calculated according to formula (5) will be equal to the calculated value, and these variables will be used as the sampling results of the RJMCMC algorithm.
4.根据权利要求1所述的一种结构可变的图案生成方法,其特征在于:在两个图案之间构建如下的能量函数,用于度量步骤S3新采样得到的新图案的好坏:4. A method for generating patterns with a variable structure according to claim 1, characterized in that: the following energy function is constructed between the two patterns for measuring the quality of the new pattern obtained by the new sampling in step S3:
Figure FDA0003857553580000053
Figure FDA0003857553580000053
其中,μ是关系图向量,μa和μb分别是给定的图案a和图案b中元素的关系图向量;α是能量函数中第一项的权重;能量函数中第一项Fvalid(μ)定义为:Wherein, μ is the relation diagram vector, and μ a and μ b are the relation diagram vectors of elements in the given pattern a and pattern b respectively; α is the weight of the first term in the energy function; the first term F valid ( μ) is defined as: Fvalid(μ)=μ-σ(μ) (9)F valid (μ)=μ-σ(μ) (9) 其中σ(μ)是关系图向量中的元素与其关系的实际值所组成的新的向量集合Where σ(μ) is a new set of vectors composed of the elements in the relationship diagram vector and the actual value of their relationship
Figure FDA0003857553580000054
Figure FDA0003857553580000054
其中σi(μ)代表σ(μ)向量中的第i项,μi代表μ向量中的第i项,如果μ中的第i项是图案中一个元素的信息,则σ(μ)中的第i项保持μ中的第i项的值依旧表示图案中该元素的相同信息;如果μ中的第i项是图案中一个元素与元素之间的关系的值,σ(μ)中的第i项则是该关系实际的值;
Figure FDA0003857553580000055
则是从节点Ni所代表的元素的若干个信息中获取到计算所需要的位置信息、方向信息或者角度信息,则
Figure FDA0003857553580000056
表示根据节点Ni所代表的关系类型利用其相关的两个输入节点Ni1和Ni2所包含的相应的元素信息计算出该关系的实际值;如果μ中的第i项是关系图向量中一个关系与关系之间的关系值,σ(μ)中的第i项同样是该关系的实际值,则
Figure FDA0003857553580000057
表示根据节点Ni所代表的关系类型利用其相关的两个输入节点Ni1和Ni2所包含的关系值计算出该关系的实际值;
Where σ i (μ) represents the i-th item in the σ(μ) vector, and μ i represents the i-th item in the μ vector, if the i-th item in μ is the information of an element in the pattern, then in σ(μ) The i-th item in μ keeps the value of the i-th item in μ still representing the same information of the element in the pattern; if the i-th item in μ is the value of the relationship between an element and an element in the pattern, the value of the i-th item in σ(μ) The i item is the actual value of the relationship;
Figure FDA0003857553580000055
It is to obtain the position information, direction information or angle information required for the calculation from several pieces of information of the elements represented by the node N i , then
Figure FDA0003857553580000056
Indicates that according to the relationship type represented by node N i , the actual value of the relationship is calculated by using the corresponding element information contained in the two related input nodes N i1 and N i2 ; if the i-th item in μ is in the relationship graph vector The relationship value between a relationship and the relationship, the i-th item in σ(μ) is also the actual value of the relationship, then
Figure FDA0003857553580000057
Indicates that according to the relationship type represented by node N i , the actual value of the relationship is calculated by using the relationship values contained in the two related input nodes N i1 and N i2 ;
β是能量函数中第二项的权重,用户约束采样得到的新图案中的一些元素是保持给定的图案a和图案b中的一些元素的位置、大小和方向,因此Fconstrain(μ,μab)定义为衡量新图案的关系图向量中受到约束的元素的信息与其指定的图案中的元素的信息之间的差距:β is the weight of the second item in the energy function. Some elements in the new pattern obtained by user constraint sampling are to maintain the position, size and direction of some elements in the given pattern a and pattern b, so F constrain (μ,μ a , μ b ) is defined as the measure of the gap between the information of the constrained elements in the graph vector of the new pattern and the information of the elements in the specified pattern:
Figure FDA0003857553580000061
Figure FDA0003857553580000061
其中Eca表示新图案中受到约束需要保持图案a中的元素信息的元素集合,E'ca表示Eca中的元素需要保持的图案a中的元素集合;Ecb表示新图案中受到约束需要保持图案b中的元素信息的元素集合,E'cb表示Ecb中的元素需要保持的图案b中的元素集合;μ{Eca}表示Eca集合中的元素在新图案的关系图向量μ中的元素信息;μa{E'ca}表示E'ca集合中的元素在图案a的关系图向量μa中的元素信息;μb{E'cb}表示E'cb集合中的元素在图案b的关系图向量μb中的元素信息;Where E ca represents the set of elements in the new pattern that are constrained to keep the element information in pattern a, E' ca represents the set of elements in pattern a that the elements in E ca need to maintain; E cb represents the set of elements in the new pattern that are constrained and need to maintain The element set of element information in pattern b, E' cb means the element set in pattern b that the elements in E cb need to keep; μ{E ca } means that the elements in the E ca set are in the relationship graph vector μ of the new pattern μ a {E' ca } means the element information of the elements in the E' ca set in the pattern a vector μ a ; μ b {E' cb } means the elements in the E' cb set are in the pattern The element information in the relationship diagram vector μ b of b; γ是能量函数中第三项的权重,Fgroup(μ)定义为衡量对称关系组与其平均值之间的差距:γ is the weight of the third term in the energy function, and F group (μ) is defined to measure the distance between the symmetric relation group and its mean value:
Figure FDA0003857553580000062
Figure FDA0003857553580000062
Fgroup(μ)是由关系图向量μ中所有对称关系组与其平均值之间的差距所组成的一维向量,图案中的元素对称性在关系图向量中表现为关系值,G表示对称关系组的关系值相等的集合,设新生成的图案中有H个关系值相等的集合,μ{Gh}表示第h个集合中的关系在关系图向量中的值所组成的向量,H=1~h,
Figure FDA0003857553580000063
表示第h个集合中所有关系值的平均值;
F group (μ) is a one-dimensional vector composed of the gap between all symmetric relationship groups in the relationship graph vector μ and their average value. The symmetry of elements in the pattern is expressed as the relationship value in the relationship graph vector, and G indicates the symmetric relationship Sets with equal relationship values in the group, assuming that there are H sets with equal relationship values in the newly generated pattern, μ{G h } represents the vector composed of the values of the relationship in the hth set in the relationship graph vector, H= 1~h,
Figure FDA0003857553580000063
Indicates the average value of all relationship values in the hth set;
δ是能量函数中第四项的权重,从给定的图案a和图案b中随机选择一个图案作为新图案的指导图案,该指导图案的关系图向量表示为τ,因此Flocal(μ,τ)定义为衡量新图案与指导图案之间的差距:δ is the weight of the fourth item in the energy function, randomly select a pattern from the given pattern a and pattern b as the guiding pattern of the new pattern, and the relationship graph vector of the guiding pattern is expressed as τ, so F local (μ,τ ) is defined as a measure of the gap between the new pattern and the guide pattern: Flocal(μ,τ)=μ-τ (13)。F local (μ,τ)=μ−τ (13).
5.一种图案生成浏览界面的方法,所述图案由权利要求4所述结构可变的图案生成方法生成,其特征在于,包括以下步骤:5. A method for pattern generation browsing interface, said pattern is generated by the pattern generation method with variable structure according to claim 4, characterized in that, comprising the following steps: 1)、获取采样得到的新图案的高维向量表达特征,得到高维向量空间;所述高维向量表达特征采用该图案的关系图向量表示;1), obtain the high-dimensional vector expression feature of the new pattern that sampling obtains, obtain high-dimensional vector space; Described high-dimensional vector expression feature adopts the relation graph vector representation of this pattern; 2)、采用高斯过程隐变量模型将高维向量空间压缩到二维流形空间;2), using the Gaussian process hidden variable model to compress the high-dimensional vector space into a two-dimensional manifold space; 3)、将二维流形空间中的点逆映射到高维空间中,得到新的图案,并对其进行后处理;3) Inversely map the points in the two-dimensional manifold space to the high-dimensional space to obtain a new pattern, and perform post-processing on it; 4)、生成图案浏览界面,所述图案浏览界面分为两个部分,一部分是得到的二维流形热图,用户通过鼠标在二维流形热图上滑动,另一部分会出现相应的新图案。4), generate a pattern browsing interface, the pattern browsing interface is divided into two parts, one part is the obtained two-dimensional manifold heat map, the user slides on the two-dimensional manifold heat map through the mouse, and the other part will appear corresponding new pattern. 6.根据权利要求5所述的图案生成浏览界面的方法,其特征在于,步骤2)的压缩是使用高斯过程隐变量模型工具箱,该工具箱将高维向量表达特征降维成二维向量,形成二维流形空间,所有的二维向量作为相应的坐标,所述坐标确定采样结果的高维向量空间的二维流形。6. the method for pattern generation browsing interface according to claim 5, is characterized in that, the compression of step 2) is to use Gaussian process latent variable model toolbox, and this toolbox will high-dimensional vector expression feature dimension reduction into two-dimensional vector , forming a two-dimensional manifold space, all two-dimensional vectors are used as corresponding coordinates, and the coordinates determine the two-dimensional manifold of the high-dimensional vector space of the sampling result. 7.根据权利要求5所述的图案生成浏览界面的方法,其特征在于,步骤3)具体是通过高斯过程隐变量模型工具箱将二维流形空间中的点的坐标逆映射到得到相应的新关系图向量,一个全新的关系图向量确定一个全新的图案。7. the method for pattern generation browsing interface according to claim 5, is characterized in that, step 3) specifically is by Gaussian process hidden variable model toolbox the coordinate inverse mapping of the point in the two-dimensional manifold space to obtain corresponding New Diagram Vector, a brand new diagram vector defines a brand new pattern. 8.根据权利要求5所述的图案生成浏览界面的方法,其特征在于,步骤3)是通过如下的图案修复函数进行后处理,用于修复图案中存在的对称关系:8. the method for pattern generation browsing interface according to claim 5, is characterized in that, step 3) is to carry out post-processing by following pattern repair function, is used to repair the symmetrical relationship that exists in the pattern:
Figure FDA0003857553580000071
Figure FDA0003857553580000071
其中μ*是满足式(14)的最小值的图案关系图向量,μ是修复函数的变量,μ0是需要通过此函数进行修复的图案的关系图向量。Among them, μ * is the vector of the pattern relationship diagram satisfying the minimum value of formula (14), μ is the variable of the repair function, and μ 0 is the vector of the relationship diagram of the pattern that needs to be repaired by this function.
CN201910425318.7A 2019-05-21 2019-05-21 A structure-variable pattern generation and a method for generating a browsing interface using patterns Expired - Fee Related CN110222239B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910425318.7A CN110222239B (en) 2019-05-21 2019-05-21 A structure-variable pattern generation and a method for generating a browsing interface using patterns

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910425318.7A CN110222239B (en) 2019-05-21 2019-05-21 A structure-variable pattern generation and a method for generating a browsing interface using patterns

Publications (2)

Publication Number Publication Date
CN110222239A CN110222239A (en) 2019-09-10
CN110222239B true CN110222239B (en) 2022-12-16

Family

ID=67821561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910425318.7A Expired - Fee Related CN110222239B (en) 2019-05-21 2019-05-21 A structure-variable pattern generation and a method for generating a browsing interface using patterns

Country Status (1)

Country Link
CN (1) CN110222239B (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6865325B2 (en) * 2001-04-19 2005-03-08 International Business Machines Corporation Discrete pattern, apparatus, method, and program storage device for generating and implementing the discrete pattern

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
PATEX:exploring pattern variations;Guerrero P等;《ACM Transactions on Graphics》;20160731;第345卷(第4期);711-732 *

Also Published As

Publication number Publication date
CN110222239A (en) 2019-09-10

Similar Documents

Publication Publication Date Title
CN107122396B (en) Method for searching three-dimension model based on depth convolutional neural networks
Wu et al. DGCNN: Disordered graph convolutional neural network based on the Gaussian mixture model
Wang et al. Online feature selection with group structure analysis
Qin et al. 3D CAD model retrieval based on sketch and unsupervised variational autoencoder
Luqman et al. Fuzzy multilevel graph embedding
CN110188228A (en) A Cross-Modal Retrieval Method Based on Sketch Retrieval for 3D Models
CN111476261A (en) Community-enhanced graph convolution neural network method
Song et al. Multiobjective optimization-based hyperspectral band selection for target detection
CN105512674B (en) RGB-D object identification method and device based on the adaptive similarity measurement of dense Stereo Matching
Zhang et al. Local k-nns pattern in omni-direction graph convolution neural network for 3d point clouds
Xing et al. Block-diagonal guided DBSCAN clustering
Le Thi et al. Self-organizing maps by difference of convex functions optimization
CN113688700B (en) Real domain three-dimensional point cloud object identification method based on hierarchical attention sampling strategy
Suykens Data visualization and dimensionality reduction using kernel maps with a reference point
Peng et al. JGSED: An end-to-end spectral clustering model for joint graph construction, spectral embedding and discretization
Ren et al. Structured optimal graph-based clustering with flexible embedding
Jiawei et al. GraphSAGE++: Weighted multi-scale GNN for graph representation learning
CN102289661A (en) Method for matching three-dimensional grid models based on spectrum matching
Dou Research on personalized recommendation algorithm based on cluster analysis and artificial intelligence
Deng et al. Label propagation on k-partite graphs with heterophily
CN110222239B (en) A structure-variable pattern generation and a method for generating a browsing interface using patterns
Jiang et al. Robust 3d face alignment with efficient fully convolutional neural networks
Qv et al. LG: A clustering framework supported by point proximity relations
Cao et al. Generation of quasi‐developable Q‐Bézier strip via PSO‐based shape parameters optimization
Wu et al. Active 3-d shape cosegmentation with graph convolutional networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20221216

CF01 Termination of patent right due to non-payment of annual fee