Uniform sampling method and device on hyper-ellipsoid surface
Through the Gibbs sampling method and radial projection technology, the problem of uniform sampling of hyperellipsoids in any dimension is solved, achieving fast and efficient uniform sampling, which is suitable for many scientific fields and improves algorithm performance.
Patent Information
- Application Number
- CN202410611250.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technology is difficult to achieve uniform sampling on a hyperellipsoid surface of any dimension, especially because the integral function of the hyperellipsoid surface area is a non-elementary function, resulting in limited current methods, and the gradient vector rejection sampling method is limited to no more than three dimensions.
The Gibbs sampling method is used to uniformly sample the hyperellipsoid space. By constructing the intersection space EU-L of the hyperellipsoid space, Gibbs sampling is used to obtain uniformly distributed sample points, and they are projected radially onto the hyperellipsoid surface to achieve hyperellipsoid space. Uniform sampling on an ellipsoid.
While ensuring the uniformity of the sampling results, it achieves fast and uniform sampling on the hyperellipsoid surface of any dimension. As the dimension increases, the rejection rate decreases, improving the sampling efficiency, and is suitable for machine learning, biomedicine, astrophysics and other fields, improving improve algorithm performance.
Smart Images

Figure CN118568403A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of data sampling, and in particular to a uniform sampling method and device on a hyper-ellipsoidal surface. Background Art
[0002] In three-dimensional space, uniform sampling on the ellipsoid surface is widely used in research in the fields of biomedicine, astrophysics, etc., such as the simulation of elongated virus capsid formation (Chen, T., Glotzer, SC: Simulation studies of aphenomenological model for elongated virus capsid formation. Phys. Rev. E 75(5)(2007).), the imaging of Bacillus multilayer protein shell (Manetsberger, J., Manton, JD, Erdelyi, MJ, Lin, H., Rees, D., Christie, G., Rees, EJ: Ellipsoid localization microscopy infers the size and order of protein layers in bacillus spore coats.Biophys.J.109(10), 2058-2066(2015).), simulation of the shape of alien celestial bodies (Mao, X., McKinnon, WB, Singer, KN, Keane, JT, Beyer, RA, Greenstreet, S., Robbins, SJ, Schenk, PM, Moore, JM, Stem, SA, Weaver, HA, Spencer, JR, and, CBO: Collisions of small Kuiper beltobjects with(486958)Arrokoth: implications for its spin evolution and bulkdensity.J.Geophys.Res.Planets 126(12)(2021), etc. In higher dimensions, such as in machine learning or other data-driven algorithm development, uniform sampling on the hyperellipsoid surface is involved.
[0003] The integral function of the surface area of a hyperellipsoid is a non-elementary function, and it has no explicit expression, which makes it difficult to implement uniform sampling on the hyperellipsoid. Therefore, there are very few methods for uniform sampling on the hyperellipsoid. Currently, a feasible method is the rejection sampling method of gradient vectors (Williamson, JF: Random selection of points distributed on curved surfaces. Phys. Med. Biol. 32 (10), 1311-1319 (1987).), but this method is currently limited to situations not exceeding three dimensions, and it is necessary to develop a uniform sampling method on a hyperellipsoid of arbitrary dimensions. Summary of the invention
[0004] The purpose of the present invention is to provide a uniform sampling method and device on a hyperellipsoid of arbitrary dimensions in order to solve the problems existing in the prior art.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] In a first aspect, the present invention provides a uniform sampling method on a hyperellipsoid surface, comprising the following steps:
[0007] S1 Acquisition In space The hyperellipsoid E Ω’ Uniform data samples on E Ω’ Build separately The hyperellipsoid space E L and The hyperellipsoid space E U , where h0 = δmin{a i ; i = 1, 2, ..., n}, δ is a constant;
[0008] S2, using Gibbs sampling method to U Perform a uniform sampling to determine whether the sample point belongs to E L , if the sample point does not belong to E L , then accept, otherwise reject; get E U With E L The difference set E U-L Uniformly distributed sample points in
[0009] S3, repeat step S2 until the number of accepted samples reaches a preset number;
[0010] S4, project the sample point obtained in step S3 to E according to the radial direction of the sample point Ω’ On, we get the final sample point x.
[0011] As a preferred technical solution of the present invention, the projection calculation in step S4 includes x=εy, ε is a constant greater than 0.
[0012] As a preferred technical solution of the present invention, the superellipsoid intersection space E in step S1 U-L The construction is constructed using an orthogonal ellipsoid coordinate system or a geometrically scaled ellipsoid.
[0013] As a preferred technical solution of the present invention, the uniform sampling method on the hyperellipsoid is applied in the fields of machine learning, data-driven algorithms, biomedicine, astrophysics, and particle physics.
[0014] In a second aspect, the present invention further provides a uniform sampling device on a hyperellipsoid surface, comprising:
[0015] Building blocks for the hyperellipsoid E Ω’ Construct two hyperellipsoid spaces E L and E U , E Ω’ Included in E L and E U The intersection space E U-L ;
[0016] Sampling unit, used to sample E using Gibbs sampling method U Perform multiple uniform samplings to obtain the preset number of U-L The uniformly distributed sample points are projected radially to E Ω’ On, we get the final sample point x.
[0017] In a third aspect, the present invention further provides an electronic device, comprising:
[0018] a memory having a computer program stored thereon;
[0019] A processor is used to execute the program in the memory to implement the uniform sampling method on the hyper-ellipsoid as described in any one of the above items.
[0020] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the uniform sampling method on a hyperellipsoid as described in any one of the above items.
[0021] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0022] 1. The uniform sampling method on the hyperellipsoid surface of the present invention can achieve uniform sampling on the hyperellipsoid surface more quickly while ensuring the uniformity of the sampling results;
[0023] 2. The uniform sampling method on the hyperellipsoid surface described in the present invention reduces the rejection rate as the dimension increases, which can greatly improve the sampling efficiency;
[0024] 3. The uniform sampling method on the hyperellipsoid surface described in the present invention provides support and means for current fields such as machine learning, data-driven algorithms, biomedicine, astrophysics, particle physics, etc., and can improve the performance of the developed algorithms. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Schematic diagram of Gibbs uniform sampling in the super ellipsoid in Example 1;
[0026] Figure 2 This is a schematic diagram of uniform sampling on the ellipsoid surface in Example 1;
[0027] Figure 3 This is an example of the uniform sampling result of the superellipsoid in Example 1;
[0028] Figure 4 is a schematic diagram of the training set in Example 2;
[0029] Figure 5 This is a recognition schematic diagram after the naive Bayes classifier is directly trained using the training set in Example 2;
[0030] Figure 6 This is a schematic diagram of the method of Example 1 used to expand the training set in Example 2;
[0031] Figure 7 This is a recognition diagram after the naive Bayes classifier is trained using the expanded training set in Example 2. DETAILED DESCRIPTION
[0032] The present invention is further described in detail below in conjunction with test examples and specific implementation methods. However, this should not be understood as the scope of the above subject matter of the present invention being limited to the following embodiments, and all technologies realized based on the content of the present invention belong to the scope of the present invention.
[0033] Unless otherwise specified, in the description of the specific embodiments of the present invention, the terms indicating the orientation or position relationship such as "up", "down", "left", "right", "center", "inside", "outside", etc. are all expressions based on the orientation or position relationship shown in the drawings, or the orientation or position relationship when the invented product / equipment / device is usually used. These terms of orientation or position relationship are only for the convenience of describing the scheme of the present invention or simplifying the description in the specific embodiments, so as to facilitate the technicians to quickly understand the scheme, rather than indicating or implying that a specific device / component / element must have a specific orientation, or be constructed and operated in a specific position relationship, and therefore cannot be understood as a limitation on the present invention.
[0034] In addition, if the terms "horizontal", "vertical", "overhanging", "parallel" and the like appear, it does not mean that the corresponding devices / components / elements are required to be absolutely horizontal or vertical or overhanging or parallel, but may be slightly tilted or have deviations. For example, "horizontal" only means that its direction is more horizontal than "vertical", and does not mean that the structure must be completely horizontal, but may be slightly tilted. Alternatively, it can be simplified to mean that the corresponding devices / components / elements are set in directions such as "horizontal", "vertical", "overhanging", "parallel", etc., and can have an error / deviation of ±10% relative to the corresponding direction setting, more preferably an error / deviation within ±8%, more preferably an error / deviation within ±6%, more preferably an error / deviation within ±5%, and more preferably an error / deviation within ±4%. As long as the corresponding device / component / element is within the error / deviation range, it can still achieve its role in the scheme of the present invention.
[0035] In addition, the expressions “first”, “second”, “third”, etc. that appear in the terms are merely descriptions used to distinguish the same or similar components and should not be understood as emphasizing or implying the relative importance of specific components.
[0036] In addition, in the description of the embodiments of the present invention, "several", "plurality" and "a number" represent at least 2. It can be any number such as 2, 3, 4, 5, 6, 7, 8, 9, and even more than 9.
[0037] In addition, in the description of the technical solution of the present invention, unless otherwise clearly specified / defined / restricted, the terms "set", "install", "connect", "connected", "provided with", "laid", and "arranged" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection, and can be welding, riveting, bolting, threading, and other commonly used connection means in the field. This connection can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection, or an indirect connection through an intermediate medium, and it can be the internal connection of two elements.
[0038] In the related art, a currently achievable method is the rejection sampling method of the gradient vector, but this method is currently limited to the case of no more than three dimensions, and it is necessary to develop a uniform sampling method on a hyperellipsoid of any dimension. Figures 1 to 3 To elaborate.
[0039] Example 1
[0040] In the n-dimensional rectangular coordinate system (X1, X2, ..., X n ), the hyperellipsoid equation can be written as The equation of the hyperellipsoid can be written as Among them, a1, a2, ..., a n is the characteristic parameter of the ellipsoid or ellipsoidal surface, a i That is, the semi-axis length of the ellipsoid or ellipsoidal surface in the i-th coordinate direction, and n is a positive integer.
[0041] In the n-dimensional polar coordinate system (θ1,θ2,...,θ n-1 ,r), n is a positive integer, the volume V of the n-dimensional hyperellipsoid n and surface area S n Can be expressed as (Hou Linbo. Volume and area formula of ellipsoid crown [D]. Guizhou Normal University, 2008):
[0042]
[0043] Provisiona i Arrange from large to small, that is, a i ≥a i+1 (i=1,2,...,n-1), the surface area of the hyperellipsoid can be expressed as:
[0044]
[0045] Where:
[0046]
[0047] Ω'={(θ1,θ2,...,θ n-1 ):0≤θ i ≤π,i=1,...,n-2,0≤θ n-1 ≤2π}
[0048] From formula (2), we can see that the integral function of the surface area of the hyperellipsoid is a non-elementary function, and it has no explicit expression. Uniform sampling on the hyperellipsoid is a thorny problem. Through extensive research on this problem, no method has been found so far. A feasible method seems to be a sampling method based on manifold parameterized mapping ((Diaconis, Persiet al. Sampling From A Manifold [J]. arXiv: Statistics Theory, 2013, 10: 102-125.)). By trying this method, we found that since the hyperellipsoid area formula is an integral of a non-elementary function, it is difficult to find or obtain the marginal distribution, reference distribution and conditional distribution of the mapping parameters, which makes the commonly used inverse sampling method, rejection sampling method and Markov Monte Carlo method (Andrieu, C., de Freitas, N., Doucet, A. et al. An Introduction to MCMC for Machine Learning. Machine Learning 50, 5–43, 2003) unable to be applied.
[0049] The hyperellipsoid is a convex space, and it is relatively easy to implement uniform sampling of this type of convex space using the Gibbs sampling method. The Gibbs sampling method is a type of Markov Monte Carlo sampling method (Tanner, MA Markov Chain Monte Carlo: The Gibbs Sampler and the Metropolis Algorithm. In: Tools for Statistical Inference [M]. Springer Series in Statistics. Springer, New York, 1993; S. Geman and D. Geman. Stochastic Relaxation, Gibbs Distributions, and the Bayesian Restoration of Images [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1984, 6: 721-741.). Taking a two-dimensional hyperellipsoid (i.e., an elliptical surface) with a major axis a1 = 2 and a minor axis a2 = 1 as an example, uniform sampling within the hyperellipsoid using the Gibbs method can be implemented by the following steps: Figure 1 shown.
[0050] A1. Calculate the intersection of the X1 axis and the ellipse (a1, 0), and generate random numbers uniformly in the interval [0, a1] Get the point
[0051] A2, passing point Calculate the coordinates of the intersection point 1 with the ellipse along the X2 axis (A1, B1), and generate random numbers uniformly in the interval [0, B1] Get the sample
[0052] A3, passing point Calculate the coordinates of the intersection point 2 with the ellipse along the X1 axis (A2, B2). Generate random numbers uniformly in an interval Get the sample
[0053] A4, passing point Calculate the coordinates of the intersection point 3 with the ellipse along the X2 axis (A3, B3). Generate random numbers uniformly in an interval Get the sample
[0054] A5. Repeat the above steps to obtain m samples in the ellipse that satisfy uniform distribution.
[0055] The above is an example of Gibbs uniform sampling in a two-dimensional hyperellipsoid. For the n-dimensional case, the principles and steps are the same as those for the two-dimensional case. The uniform sampling of Gibbs in a hyperellipsoid can be summarized as follows:
[0056] Gibbs-based uniform sampling algorithm within the hyperellipsoid:
[0057] B1. Select a point inside the hyperellipsoid and set it as
[0058] B2, cyclic sampling for t=0,1,...,j,...;
[0059] B21. Find the value of x passing through the fixed point 0 The intersection of the straight line parallel to the x1 axis and the ellipsoid surface can obtain an upper and lower boundary point of x1 at this time, set as from Uniform sampling of the interval
[0060] B22. Find the point through which the The intersection of the straight line parallel to the x2 axis and the ellipsoid surface gives The average value of Select evenly from this interval
[0061] B23,…
[0062] B24, find the point through which the Parallel to x i The intersection of the straight line in the axis direction and the ellipsoid surface gives The average value of Select evenly from this interval
[0063] B25,…
[0064] B26, find the fixed point Parallel to x n The intersection of the straight line in the axis direction and the ellipsoid surface gives The average value of Select evenly from this interval
[0065] The hyperellipsoid is a low-dimensional space of the hyperellipsoid. If uniform sampling can be performed in the hyperellipsoid space near the hyperellipsoid and then projected onto the hyperellipsoid in a certain way, approximate uniform sampling on the hyperellipsoid can be achieved. Based on this idea, the present invention proposes a simplified and approximate uniform sampling method on the hyperellipsoid, and analyzes and verifies the uniformity and efficiency of its sampling.
[0066] The uniform sampling method on a hyperellipsoid surface described in the present invention comprises the following steps:
[0067] S1. For In space The hyperellipsoid surface (denoted as E Ω’ ), based on E Ω’ Build separately and The hyperellipsoid space is denoted by E L and E U , where h0 = δmin{a i ; i=1,2,...,n}, δ can generally be taken as 0.05; take a hyperellipsoid (i.e., ellipse) with major axis a1=2 and minor axis a1=1 as an example, Figure 2 As shown;
[0068] S2, using Gibbs sampling method to U Perform a uniform sampling to determine whether the sample point belongs to the super ellipsoid E L Space, if the sample point does not belong to E L space, then accept, otherwise reject; this step obtains the hyperellipsoid E U With E L The spatial difference set (denoted as E U-L ) in the uniformly distributed sample points, denoted as for Figure 2 The example is recorded as
[0069] S3, repeat step S2 until the number of accepted samples reaches the specified number m, at which point the samples are uniformly distributed in the hyperellipsoid difference space E U-L , denoted as (y 1 ,y 2 ,...,y t ,...,y m ),
[0070] S4, for the sample point obtained in step S3, the radial direction of the sample point (the direction of the line connecting the sample point and the origin, that is, Figure 2 In As shown in Figure 2, the projected points (x) on the hyperellipsoid are the sample points (x 1 ,x 2 ,...,x t ,...,x m ); the projection calculation formula is:
[0071]
[0072] The derivation process of formula (3) is as follows:
[0073] ① For the sample points in the ellipsoid difference space According to step S4, vector
[0074] ② according to The sample points projected onto the ellipsoid are recorded as
[0075] ③ Due to Directional projection, so the sample point The line connecting the origin is parallel to Then there exists a constant ε greater than 0 such that:
[0076]
[0077] ④ Cause Located on the ellipsoid, Substituting into formula (4), we can get:
[0078]
[0079]
[0080] The sampling method proposed above is an approximation method for uniform sampling on a hyperellipsoid. If we want to accurately obtain the error expression of this method, it involves the integral of the hyperellipsoid and cannot be expressed explicitly. We use a combination of theory and numerical simulation to analyze it.
[0081] 1. Theoretical analysis
[0082] (1) Because E U-L The sample points in the space are uniformly distributed, and their probability density is a constant, which is 1 / dV n =1 / V n According to formula (1), dV n for:
[0083]
[0084] (2) According to formula (2), in Ω'={(θ1,θ2,...,θ n-1 ):0≤θ i ≤π,i=1,...,n-2,0≤θ n-1 ≤2π} space, dS n As follows:
[0085]
[0086] (3) Let dS n The upper probability density is h(h0,θ1,θ2,...,θ n-1 ), because h0 is small enough, it is assumed here that the projection is to dS n is still uniform, that is, h(h0,θ1,θ2,...,θ n-1 )≈h(θ1,θ2,...,θ n-1 ); because in the above sample point projection process (step S4) along the sample point radial direction, in dV n All points in must be projected onto dS n , according to the principle of equal probability, Then h(θ1, θ2, ..., θ n-1 )for
[0087]
[0088] (4) From formula (9), we can see that when h(θ1,θ2,...,θ n-1 )=h c When S is a constant, the sample point is n The distribution on is uniform, and the sampling error depends on h(θ1,θ2,...,θ n-1 ) The degree of unevenness is related to a max / amin related.
[0089] (5) According to formula (9), the unevenness It is independent of h0, which does not mean that the error of the proposed sampling method is independent of h0. Therefore, when h0 is small enough (0.05min{a i ; i=1,2,...,n}), the above process ignores the projection of the sample to dS in "step S4". n The error caused by unevenness.
[0090] 2. Numerical verification
[0091] (1) To more intuitively examine the uniformity of the sampling results of the proposed sampling method, Figure 3 (a), (b), and (c) show the h0 = 0.05min{a i ; i=1,2,...,n}, n=2,3,4, where Figure (c) is a “slice” diagram of the uniform sampling result on the 4-dimensional hyperellipsoid at x1∈[0.195,0.205]. Figure 3 It can be seen that the sampling results are relatively uniform.
[0092] (2) In order to further verify the uniformity of the sampling results of the proposed method, the Monte Carlo numerical integration method was used for verification, as shown in formula (10).
[0093]
[0094] Where: x i1 is the first dimension (can be any dimension) coordinate value of the uniform sampling point on the hyperellipsoid;
[0095] S n is the area of the hyperellipsoid, which can be obtained by numerical integration;
[0096] N is the number of samples.
[0097] Table 1 gives the values of n = 2, 3, 5, h0 = 0.05min{a i ; i=1,2,...,n}, a max / a min ∈[1,9], and compared with the numerical integration results. As can be seen from Table 1, as a max / a min The increase in the deviation has a tendency to increase, but even if a max / a minWhen it reaches 9, the maximum deviation does not exceed 6%; in addition, with the increase of dimension, the error does not become uncontrollable, but tends to decrease; the above two points show that the accuracy of uniform sampling of the hyperellipsoid by using the proposed sampling method is acceptable, and h0 can be taken as 0.05min{a i ; i=1,2,...,n}.
[0098] Table 1 Verification results of uniform sampling method on hyperellipsoid surface
[0099]
[0100] Note: The data in Table 1 are the results of 10,000 sampling times.
[0101] In the proposed sampling method, step S2 needs to reject samples that do not meet the requirements. The following is an analysis of the variation of the sampling rejection rate with the dimension n. The rejection rate of the samples in step S2 of the proposed sampling method depends on the space E U-L The volume of E U The proportion of space is based on formula (1):
[0102]
[0103] From formula (11), we can see that (a i -h0 / 2) / (a i +h0 / 2) is always less than 1. As the dimension increases, E U-L The volume of will become larger and larger, that is, the acceptance rate is getting higher and higher, and the rejection rate is getting lower and lower. The calculation results in Table 1 also confirm this. In addition, it can be seen from Table 1 that with the increase of a max / a min As n=5 and a increases, the acceptance rate decreases, the error increases, and the sampling time increases. max / a min When =9, it takes only 3.375s to sample 10000 sample points, and the acceptance rate is still 37.2%, which shows that the proposed sampling method has good sampling efficiency.
[0104] (3) The construction of the super-ellipsoid intersection space can also be carried out by other methods, such as using an orthogonal ellipsoid coordinate system and geometrically scaling the ellipsoid. However, these two methods will bring large errors and will not be elaborated here.
[0105] The uniform sampling method on the hyperellipsoid surface described in the present invention can achieve uniform sampling on the hyperellipsoid surface more quickly while ensuring the uniformity of the sampling results; the rejection rate of the proposed method decreases with the increase of the dimension, which can greatly improve the sampling efficiency; max / a minAs the sampling uniformity decreases, the uniformity of the sampling results decreases. However, within the verified range, even if a max / a min When it reaches 9, the maximum deviation does not exceed 6%; it can improve the performance of the developed algorithm and apply it to machine learning, data-driven algorithms, biomedicine, astrophysics, particle physics and other fields.
[0106] Example 2
[0107] The uniform sampling method on a hyperellipsoid described in the present invention can be used to improve the performance of data-driven algorithms. Take the Adélie and Chinstrap penguin data set obtained by Dr. Kristen Gorman and the Palmer Research Station of LTER in Antarctica as an example (see https: / / www.kaggle.com / datasets / parulpandey / palmer-archipelago-antarctica-penguin-data), which is often used to test various machine learning models. The data set contains data such as the length of the beak, the depth of the beak, the length of the sole of the foot, and the weight of the penguins.
[0108] 100 Adélie penguin data and 10 chinstrap penguin data were randomly selected as training sets, with a total of 110 training samples. The machine learning model was trained using the training set, and the remaining 58 chinstrap penguin data were predicted using the trained learning model to examine the learning effect of the model. Three parameters, namely, beak peak length, beak peak depth, and paw length, were taken for each data sample. Figure 4 shown.
[0109] For the training set, the ratio of Adélie to Chinstrap penguin data is 10:1, which is an unbalanced sample, increasing the difficulty of the classification algorithm to identify the two. Taking the naive Bayes classifier as an example, after training the naive Bayes classifier with the training set, the classifier can only accurately identify 31 of the 58 chinstrap penguin data in the test set, with an accuracy rate of 53.4%. Figure 5 shown.
[0110] According to the following steps, a small sample of the training set (10 chinstrap penguin data) is expanded based on the method of the present invention to improve the performance of the naive Bayes classifier.
[0111] (1) Calculate the Mahalanobis distance between each chinstrap penguin data set in the training set and the Adélie penguin data set according to the following formula;
[0112]
[0113] In the formula, x iis the sample vector of chinstrap penguins in the training set, μ is the mean vector of the Adélie penguin dataset, ∑ -1 is the covariance matrix of the Adélie penguin data set, i=1,2,...,10.
[0114] (2) Based on the Mahalanobis distance d(x) from each chinstrap penguin data set to the Adélie penguin data set i ), can be expanded to include samples y that satisfy the following constraint equations i ;
[0115] d 2 (x i )=(y i -μ) T ∑ -1 (y i -μ) (13)
[0116] (3) Formula (13) is a hyperellipsoidal surface equation. After rotating and translating it, we can get a standard hyperellipsoidal surface. For this case, the standard hyperellipsoidal surface equation is:
[0117]
[0118] (4) For each chinstrap penguin data set to the Adélie penguin data set, the Mahalanobis distance d(x i ), the hyperellipsoid of formula (14) is uniformly sampled 10 times by the method of the present invention, and after reverse translation and reverse rotation according to step (3), 100 samples of chinstrap penguins in the training set can be expanded, as shown in FIG. Figure 6 shown.
[0119] (5) Using the training set expanded in step (4), the naive Bayes classifier is retrained. The trained classifier can accurately identify 56 of the 58 chinstrap penguin data in the test set, with an accuracy rate of 96.6%. Figure 7 shown.
[0120] Based on the uniform sampling method on the hyperellipsoid described in the present invention, small samples in the unbalanced data set are expanded to improve the performance of the machine learning algorithm. In this case, after the unbalanced samples in the training set are expanded based on the method of the present invention, the prediction accuracy of the naive Bayes classifier is improved from 53.4% to 96.6%.
[0121] Example 3
[0122] The improvement of machine model performance by a uniform sampling method on a hyperellipsoid surface described in the present invention is not limited to 3 dimensions, and can be applied to higher dimensions. This case still uses the 100 Adélie and 10 chinstrap penguin data of Example 2 as the training set, and the 58 chinstrap penguin data as the test set, and adds penguin weight parameters, that is, each data sample contains four dimensions: beak length, beak depth, paw length, and weight, to illustrate the improvement effect of the method of the present invention on the performance of the naive Bayes model.
[0123] Similar to Example 2, the 10 chinstrap penguin data sets in the training set can be expanded by the following hyperellipsoid equation.
[0124]
[0125] Similar to Example 2, the Mahalanobis distance d(x i ), the method of the present invention is used to uniformly sample the hyperellipsoid specified by formula (15) 10 times, and 100 samples of chinstrap penguins are added to the training set.
[0126] Similar to Example 2, after the unbalanced samples in the training set were expanded based on the method of the present invention, the prediction accuracy of the naive Bayes classifier was improved from 53.4% to 84.5%.
[0127] Example 4
[0128] In particle physics simulation, it is necessary to simulate the movement or distribution of particles in a specific shape space. As a geometric body that can describe complex shapes, the hyperellipsoid has important applications in particle physics simulation. This embodiment uses the uniform sampling method on the hyperellipsoid surface described in Example 1 to simulate the distribution of particles on the hyperellipsoid surface.
[0129] According to the needs of particle physics simulation, the equations of the hyperellipsoid space are defined, assuming that the simulation is a particle distribution in a three-dimensional space, where the major and minor axes of the hyperellipsoid have specific physical meanings, such as being related to the energy, momentum and other properties of the particle.
[0130] The particle sample points generated by the method of the present invention are used to analyze the distribution characteristics of particles on the hyperellipsoid surface. By statistically analyzing the position, density and other information of the particles, the distribution of the particles on the hyperellipsoid surface can be understood. According to the distribution characteristics of the particles, the physical processes of the particles on the hyperellipsoid surface, such as collision and decay, can be simulated. By comparing the differences in simulation results under different sampling methods, the accuracy and reliability of the sampling method proposed by the present invention can be verified.
[0131] Example 5
[0132] The uniform sampling device on a hyperellipsoidal surface of the present invention comprises:
[0133] Building blocks for the hyperellipsoid E Ω’ Constructing the hyperellipsoid intersection space E L and E U , E Ω’ Included in E L and E U The intersection space E U-L ;
[0134] Sampling unit, used to sample E using Gibbs sampling method U Perform multiple uniform samplings to obtain the preset number of U-L The uniformly distributed sample points are projected radially to E Ω’ On, we get the final sample point x.
[0135] The uniform sampling device on the hyper-ellipsoid surface can use the uniform sampling method on the hyper-ellipsoid surface described in Example 1.
[0136] Example 6
[0137] An electronic device according to the present invention comprises:
[0138] a memory having a computer program stored thereon;
[0139] A processor is used to execute the program in the memory to implement the uniform sampling method on the hyperellipsoid as described in Example 1.
[0140] As a preferred solution of this embodiment, the electronic device may include: a processor, a memory, and the electronic device may also include one or more of a multimedia component, an input / output (I / O) interface, and a communication component.
[0141] The processor is used to control the overall operation of the electronic device to complete all or part of the steps in the uniform sampling method on the hyper-ellipsoid surface.
[0142] The memory is used to store various types of data to support the operation of the electronic device, which data may include, for example, instructions for any application or method operating on the electronic device, and application-related data; the memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0143] The multimedia component may include a screen and an audio component, wherein the screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals; for example, the audio component may include a microphone for receiving external audio signals, and the received audio signals may be further stored in a memory or sent via a communication component; the audio component also includes at least one speaker for outputting audio signals.
[0144] The I / O interface provides an interface between the processor and other interface modules, which may be a keyboard, a mouse, buttons, etc.; these buttons may be virtual buttons or physical buttons.
[0145] The communication component is used for wired or wireless communication between the electronic device and other devices; wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G or 5G, or a combination of one or more of them, so the corresponding communication component may include: Wi-Fi module, Bluetooth module, NFC module, mobile phone communication module.
[0146] As a preferred solution of this embodiment, the electronic device can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned uniform sampling method on the hyper-ellipsoid.
[0147] In addition, the computer-readable storage medium provided in the embodiment of the present disclosure may be the above-mentioned memory including program instructions, and the above-mentioned program instructions may be executed by a processor of an electronic device to complete the above-mentioned uniform sampling method on the hyperellipsoid.
[0148] Example 7
[0149] The computer-readable storage medium described in the present invention stores a computer program, which, when executed by a processor, implements the uniform sampling method on the hyperellipsoid surface described in Example 1.
[0150] Computer-readable storage media are used to store various types of data to support operations on the electronic device, which data may include, for example, instructions for any application or method operating on the electronic device, as well as application-related data; the memory may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0151] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A uniform sampling method on a hyperellipsoid, characterized in that: The following steps are involved: S1 Acquisition In space The hyperellipsoid E Ω’ Uniform data samples on E Ω’ Build separately The hyperellipsoid space E L and The hyperellipsoid space E U , where h0 = δmin{a i ; i = 1, 2, ..., n}, δ is a constant; S2, using Gibbs sampling method to U Perform a uniform sampling to determine whether the sample point belongs to E L , if the sample point does not belong to E L , then accept, otherwise reject; get E U With E L The difference set E U-L Uniformly distributed sample points in S3, repeat step S2 until the number of accepted samples reaches a preset number; S4, project the sample point obtained in step S3 to E according to the radial direction of the sample point Ω’ On, we get the final sample point x.
2. The uniform sampling method on the hyperellipsoid according to claim 1, characterized in that: The projection calculation in step S4 includes x=εy, is a constant greater than 0.
3. The uniform sampling method on the hyperellipsoid according to claim 1, characterized in that: The superellipsoid intersection space E in step S1 U-L The construction is constructed using an orthogonal ellipsoid coordinate system or a geometrically scaled ellipsoid.
4. The uniform sampling method on a hyperellipsoid according to any one of claims 1 to 3, characterized in that: Applications in machine learning, data-driven algorithms, biomedicine, astrophysics, and particle physics.
5. A uniform sampling device on a hyperellipsoid, characterized in that: include: Building blocks for the hyperellipsoid E Ω’ Construct two hyperellipsoid spaces E L and E U , E Ω’ Included in E L and E U The intersection space E U-L ; Sampling unit, used to sample E using Gibbs sampling method U Perform multiple uniform samplings to obtain the preset number of U-L The uniformly distributed sample points are projected radially to E Ω’ On, we get the final sample point x.
6. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the program in the memory to implement the uniform sampling method on the hyper-ellipsoidal surface as described in any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the uniform sampling method on the hyper-ellipsoidal surface as described in any one of claims 1 to 4 is implemented.
