Neural-Network-Based Curve Fitting Using Totally Positive Rational Bases

: This paper proposes a method for learning the process of curve ﬁtting through a general class of totally positive rational bases. The approximation is achieved by ﬁnding suitable weights and control points to ﬁt the given set of data points using a neural network and a training algorithm, called AdaMax algorithm, which is a ﬁrst-order gradient-based stochastic optimization. The neural network presented in this paper is novel and based on a recent generalization of rational curves which inherit geometric properties and algorithms of the traditional rational Bézier curves. The neural network has been applied to different kinds of datasets and it has been compared with the traditional least-squares method to test its performance. The obtained results show that our method can generate a satisfactory approximation.


Introduction
The problem of obtaining a curve that fits a given set of data points is one of the fundamental challenges of Computer Aided Geometric Design (CAGD), and it has become prevalent in several applied and industrial domains, such as Computer-Aided Design and Manufacturing (CAD/CAM) systems, Computer Graphics and Animation, Robotics Design, Medicine and many others. To face this issue, several families of bases of functions have been considered. There is a large body of literature on this topic and there are numerous methods to solve this issue, such as several least-squares techniques and different progressive iterative approximation methods (see [1][2][3] and the references therein).
Given a system (u 0 , . . . , u n ) of linearly independent functions defined on an interval I ⊆ R and P 0 , . . . , P n ∈ R k , we can define a parametric curve as γ(t) = ∑ n i=0 P i u i (t), t ∈ I. The polygon P 0 · · · P n , formed by the ordered sequence of points P i ∈ R k , i = 0, . . . , n, is called the control polygon of γ and the points P i , i = 0, . . . , n, are named the control points of γ with respect to (u 0 , . . . , u n ). A matrix is totally positive (TP) if all its minors are nonnegative (see [4]). A system of functions (u 0 , . . . , u n ) defined on I is TP if all its collocation matrices u j (t i ) i,j=0...,n with t 0 < · · · < t n in I are TP. A TP system of functions on I is normalized (NTP) if ∑ n i=0 u i (t) = 1, for all t ∈ I. A basis provides shape-preserving representations if the shape of the curve imitates the shape of its control polygon. Normalized totally positive bases provide shape-preserving representations. The normalized B-basis of a given space is an Some recent papers have shown that the application of Artificial Intelligence (AI) techniques can achieve remarkable results regarding the problem of obtaining rational curves that fit a given set of data points. To face this issue, in [10], a bio-inspired algorithm was applied through the use of rational Bézier curves. Besides, in [11,12], evolutionary algorithms were applied to rational B-spline curves. As a novelty, in this paper, we define a one-hidden-layer neural network using the general class of rational bases with optimal shape-preserving properties proposed in [8]. In that work, the authors presented evaluation and subdivision algorithms. However, this is the first time that the problem of obtaining a rational fitting curve using these general class of totally positive rational bases is modeled by a neural network and its weights and control points optimized using a training algorithm. In this paper, we extend [8] for their application in curve fitting training the neural network with a recent stochastic learning process, the AdaMax algorithm [13], to find suitable weights and control points. In this approximation process, the rational basis is a hyperparameter and can be changed by substituting the linear factors by polynomial, trigonometric or hyperbolic functions, thus expanding the potential range of applications to include more difficult shapes.
The layout of the paper is as follows. In Section 2, we recall several concepts regarding CAGD and we present a general class of rational bases which are normalized B-bases. Then, in Section 3, we present a one-hidden-layer neural network based on the rational bases presented in the previous section to approximate a given set of data points. This neural network is trained with an optimization algorithm to update the weights and control points used to construct a curve that approximates the given set of data points, while decreasing a loss function. In Section 4, several experiments are provided illustrating the use of the neural network with different normalized B-bases to test its performance giving an approximation of different kinds of sets of data points. Moreover, the proposed method has been compared with the traditional least-squares method. Finally, conclusions and future work are presented in Section 5.

Shape-Preserving and Rational Bases
Let us suppose that I ⊆ R and f , g : I → R are nonnegative continuous functions. Then, for n ∈ N, we can define the system (u n 0 , . . . , u n n ) where: For any positive weights w n i , i = 0, . . . , n, let us define ω n (t) = ∑ n i=0 w n i u n i (t) and denote by (ρ n 0 , . . . , ρ n n ) the rational basis described by where (u n 0 , . . . , u n n ) is defined in (1). Clearly, this system spans a space of rational functions with denominator ω n (t), where U n is the space generated by (u n 0 , . . . , u n n ). The following result corresponds to Corollary 4 of [8] and provides the conditions characterizing that the system given in (2) has optimal shape-preserving properties. Proposition 1. The system of functions given in (2) is the normalized B-basis of the space R n defined in (3) if and only if the function f /g defined on I 0 = {t ∈ I | g(t) = 0} is increasing and satisfies Let us see several choices of functions f and g satisfying the conditions of Proposition 1. Let us consider the functions It is well known that the corresponding rational basis (2), which is the rational Bernstein basis, is the normalized B-basis of its generated space (3).
We can also consider the functions The corresponding rational basis (2) spans the space where the system (u 0 , . . . , u n ) given in (1) spans the space 1, t 2 , . . . , t 2n of even polynomials defined on [0, 1] of degree less than or equal to 2n. Trigonometric and hyperbolic bases are attracting a lot of interest, for instance in Isogeometric Analysis (cf. [14]). Let 0 < ∆ < π/2. Define Let us notice that the functions f and g satisfy f (t) > 0 and g(t) > 0 for all t ∈ (−∆, ∆). Moreover, it can be checked that Therefore, for any 0 < ∆ < π/2, the function f /g is a strictly increasing function on (−∆, ∆) and f and g satisfy the conditions of Proposition 1. The corresponding rational basis (2) spans the space where, for a given n = 2m, the system (u 0 , . . . , u n ) given in (1) is a basis that coincides, up to a positive scaling, with the normalized B-basis of the space 1, cos t, sin t, . . . , cos mt, sin mt of trigonometric polynomials of degree less than or equal to m on I (see Section 3 of [15]). Finally, let ∆ > 0. Define Clearly, f (t) > 0 and g(t) > 0 for all t ∈ (−∆, ∆). Moreover, it can be checked that Therefore, for any ∆ > 0, f /g is a strictly increasing function on (−∆, ∆) and f and g satisfy the conditions of Proposition 1. The corresponding rational basis (2) spans the space where, for n = 2m, the system (u 0 , . . . , u n ) given in (1) spans the space 1, e t , e −t , . . . , e mt , e −mt of hyperbolic polynomials of degree less than or equal to m on I.
In Figure 2, we illustrate two examples of the rational basis (2) of degree 3. Let us observe the effect on the shape of the functions of the basis as weights change. Section 4 will show examples of approximations of given sets of data points using all the above mentioned normalized B-bases. Moreover, the neural network presented in the following section will be used to compute the optimal weights and control points of their corresponding fitting curves.

Curve Fitting with Neural Networks
It is well known that curve fitting is the process of constructing a curve, or mathematical function, that has the best fit of a given set of data points. A related topic is Regression Analysis in Machine Learning. In the literature (see [16] (Chapter 11)), a regression problem is the problem of predicting a real value for each input data. Let us consider an input space X ⊂ R m and target values Y ⊂ R k , and a distribution over X × Y, denoted by D. Then, a regression problem consists of a set of labeled samples S = {(x i , y i )} i∈{0,..., } ∈ X × Y drawn according to D where y i are the target real values we want to predict. There exists a huge variety of regression algorithms, i.e., algorithms solving regression problems, such as Linear Regression, Decision Trees, Support Vector Regression, and Neural Networks, among others. The quality of the prediction of an algorithm or model depends on the difference between the target (i.e., the true value) and the predicted one, and it is measured using a loss function. Then, given a set H (also called "hypothesis") of function mappings X to Y, the aim of the regression algorithm is to use S to find h ∈ H such that the expected loss is small.
Specifically, the problem that we want to solve can be stated as follows. Suppose that f and g are functions defined on [a, b] satisfying the conditions of Proposition 1. Consider a set of parameters a ≤ t 0 < · · · < t ≤ b and a sequence of data points s 0 , . . . , s ∈ R k , where each parameter t i is associated with a data point s i . For some n ≤ , we want to obtain a rational curve to approximate the set of data points s = (s i ) i=0 . Therefore, the goal is to obtain the weights w n 0 , · · · , w n n and the control points P 0 , · · · , P n of the rational curve (11) that best fits the set of data points. In order to compute them, we have used a stochastic optimization process to train a neural network that models the rational curve c(t).
The problem to be solved can be interpreted then as a regression problem where the set of labeled samples is composed of the input data, X, that is the set of parameters a ≤ t 0 < · · · ≤ t ≤ b and the target set of data points Then, the expression in (11) can be represented as a hierarchical computational graph with just one hidden layer that we will denote as N w,P : R → R k where the computations are organized as in Figure 3. The obtained curve N w,P (t) is the rational curve c(t) that approximates the given set of data points and we denote as the fitting curve. Figure 3. From top to bottom. The input layer has the parameter t ∈ R as input. The hidden layer is of width n + 1 and its parameters are the weights. Then, the output layer computes the approximation of the target curve and its parameters are the control points.
The key idea is to iteratively change the input weights w = (w n i ) n i=0 and control points P = (P i ) i=0 of the active curve N w,P (t), and so it deforms towards the target shape represented by the set of data points s = (s i ) i=0 (see Figure 4). Then, we apply an adaptive learning rate optimization algorithm to train the neural network to find the weights and control points, which can be, for example, the Adaptive Moment Estimation (Adam) algorithm or its variant Adaptive Moment Estimation Maximum (AdaMax) algorithm based on infinity norm. These methods are used for stochastic optimization, to solve the supervised learning problem and to find the parameters where a minima is located. In this paper, we have mainly used the AdaMax variant (see Algorithm 1) because of its stability and simplicity [13]. However, the Adam method can be useful depending on the shape of the set of data points to be approximated and the choice of the loss function. The stochastic objective function, also called the loss function, measures the goodness of the fitting curve. Let us notice that there exist different loss functions such as the mean absolute error, the cross-entropy loss, the mean squared error, among others (the different loss functions implemented in Tensorflow can be consulted in the tensorflow documentation), that can be chosen depending on the problem. In our case, we have considered the mean absolute error as the loss function because of the choice of the training algorithm, given by the following expression: The Adam and the AdaMax algorithms are stochastic gradient-based optimization algorithms and, as previously mentioned, they update the weights and the control points iteratively. The step size is a real number that measures how much the weights and the control points are updated upon each iteration. Besides, the Adam algorithm uses the first and the second moment estimate to update the weights and the control points which are updated following exponential decay rates (β 1 and β 2 ). Finally, as AdaMax is a variation of Adam using infinity norm, the second moment estimate has a simple recursive formula which will be denoted in Algorithm 1 as exponentially weighted infinity norm. See [13] for a detailed description of the both Adam and AdaMax algorithms.
(Update the weights); The number of units (i.e. weights and control points) is a hyperparameter and is determined based on the complexity of the shape to be approximated. Besides, the step size, α, can be changed depending on the state of the convergence of the training procedure, for example, when the loss values (i.e., the evaluation of the loss function) gets stuck or the update of the parameters is too big. Then, it is useful to increase or reduce, respectively, the step size according to the values of the loss function.

Experiments Results
In order to show the performance of the neural network N w,P , we have taken different sets of data points s = (s i ) i=0 . They have been chosen to reflect the variety of situations where the proposed neural network can be applied. The first set of data points belongs to a closed conic curve, the second one belongs to a transcendental curve, the third one is a curve with a twisted shape and, finally, the fourth one is a noisy set of data points from a baroque image.
In all cases, we have taken different functions f and g satisfying the conditions of Proposition 1 and allowing that the corresponding rational bases (2) have the optimal shape-preserving properties.
Remark 1. One of the requirements for a rational basis to be the normalized B-basis of its generated space is the positivity of the weights. This makes it necessary to apply the absolute value to the weights in the weight update step of Algorithm 1. However, in the experiments shown, we opted to avoid this choice because we have observed that, although in the intermediate steps the weights could be negative, at the end of the training, the weights were positive and the convergence was faster. Nevertheless, we can add the restriction depending on the needs.
Let us notice that we have used an uniform distribution of the parameters t i , i = 0, . . . , , in all the examples. This choice of parameters does not have to be the optimal but we have preferred it because of its simplicity. Besides, a normalization of the data points, s = (s i ) i=0 , between 0 and 1, was applied in order to facilitate the training procedure following the formula: The AdaMax algorithm was applied to solve the minimization problem with the mean absolute error loss function (12) with the following choice of hyperparameters: α = 0.0001, β 1 = 0.9, β 2 = 0.999, and ε = 10 −7 . Then, the number of iterations of the algorithm depends on the desired accuracy of the fitting curve to the set of data points. In this case, we have used between 3000 to 5000 iterations of the algorithm but, with more iterations and a better tuning of the parameters, the results provided here may be improved. Finally, in order to reach a better approximation, the first and the last control point of the fitting curve were fixed to be the same as the first and the last point of the set of data points, thus the obtained fitting curve is always exactly at those points. We can see in Table 1, a summary of the loss values from different fitting curves. Let us observe that the value n is the degree of the fitting curve and it depends on the complexity of the shape to be approximated. Moreover, let us notice that the proposed neural network is able to obtain a suitable accuracy with low degrees and, as a generalization of other methods, we can choose, depending on the shape of the set of data points, the basis that best fits. Note that, in CAGD, it is important to properly address the problem of curve fitting, finding a balance between accuracy and degree of the curve since high-degree curves are computationally expensive to evaluate. The AdaMax algorithm has been selected because it is computationally efficient with little memory requirements, suited for problems with large data or parameters. In Table 2, the time of execution of the Algorithm 1 using different numbers of units (i.e., weights and control points) and numbers of iterations is provided. Table 1. Loss values of the mean absolute error (12) for different fitting curves of degree n with f (t) = t, g(t) = 1 − t, t ∈ [0, 1] (Basis 1), f (t) = t 2 and g(t) = 1 − t 2 , t ∈ [0, 1], (Basis 2), f (t) = sin ((∆ + t)/2) and g(t) = sin ((∆ − t)/2), ∆ < π/2, ∆ < π/2, t ∈ [−∆, ∆], (Basis 3) and finally f (t) = sinh ((∆ + t)/2) and g(t) = sinh ((∆ − t)/2), ∆ < π/2, t ∈ [−∆, ∆], (Basis 4). They were all trained with 4000 iterations, α = 0.0001, β 1 = 0.9, β 2 = 0.999, ε = 10 −7 . The process was repeated 5 times, with the loss values provided being the best values reached.  The implementation (the code of the experimentation can be found in https://github.com/Cimagroup/Curve-approximation-NN) was developed using TensorFlow 2.0 [17] allowing developers to easily use it to build and deploy Machine Learning powered applications. All experiments were ran on a Quad-Core Intel Core i7 CPU, 2.8 GHz with 16 GB RAM. Let us see a detailed description of the experiments.

Circle Curve
Circles and conic sections play a relevant role in curve design and have been approximated in several works (see [18,19]). Let us show different approximations to the circle given by the parametric equations t ∈ [0, 2π]. First, let us see an approximation obtained performing the neural network N w,P using polynomial functions. We have taken the following sequence of points s = (s i ) 99 i=0 on the circle (14): being the parameters t i = i/99, i = 0, . . . , 99. For n = 5, we have approximated the set s by the fitting curve (N w,P x (t), N w,P y (t)) considering the functions f (t) = t and g(t) = 1 − t at the vector nodes t = (t i ) 99 i=0 with t i as above. After training the neural network N w,P , performing the Algorithm 1 for 3000 iterations, we have obtained the following weights: We can see in Figure 5 the obtained fitting curve of degree 5 and its corresponding control polygon. In order to analyze the performance of the obtained approximation to the circle, we depict some geometric approximations of the approximation error. In Figure 6, we plot the radial and curvature errors given, respectively, by We can observe that the radial error vanishes at t = −∆, ∆ because the approximation is exact for the initial and the last points of the curve.
Let us see another approximation example of the unit circle performing the neural network N w,P using trigonometric functions. We have the following set of data points s = (s i ) 99 i=0 on circle (14): being the parameters t i = −∆ + 2∆i/99, i = 0, . . . , 99, with 0 < ∆ < π/2. For n = 5, we have approximated the set s by the fitting curve (N w,P x (t), N w,P y (t)) using the functions f (t) = sin ((∆ + t)/2) and g(t) = sin ((∆ − t)/2) at the vector nodes t = (t i ) 99 i=0 with t i as above.
After training the neural network N w,P , performing Algorithm 1 for 3000 iterations, and with α = 0.001, β 1 = 0.9, β 2 = 0.999, and ε = 10 −7 , we have obtained the following weights:  We can see in Figure 7 the fitting curve of degree 5 obtained and its control polygon.  Figure 8 shows its corresponding radial and curvature errors. We can observe that the radial error vanishes at t = −∆, ∆ because the approximation is exact for the initial and the last points of the curve. Finally, for different values of n, Figure 9 shows the history of the loss function given in (12) through the training process on 3000 iterations of the neural network N w,P using the polynomial functions and the trigonometric functions. We can observe, in both cases, that the convergence to the circle of the fitting curves is faster as n increases.

Cycloid Curve
Cycloids are commonly used in manufacturing applications (e.g. gear tooth geometry). The cycloid is a transcendental curve and thus, it cannot be expressed by polynomials exactly. Creating a complex curve in a CAD/CAM system is not always straightforward. In [20], it is shown the need to new methods for approximating this curve. Let us show different approximations to the cycloid by several fitting curves obtained by training the neural network N w,P using polynomial, trigonometric and hyperbolic functions f and g that satisfy the conditions of Proposition 1.
The cycloid is given by the parametric equations For n = 10, we have approximated the set s by two fitting curves at the vector nodes t = (t i ) 99 i=0 with t i as above. One of the fitting curves is obtained using the functions f (t) = t and g(t) = 1 − t, and the other fitting curve is obtained using the functions f (t) = t 2 and g(t) = 1 − t 2 .
We can see in Figure 10, the fitting curves and their corresponding fitting error. The fitting error is given by the Euclidean norm between the approximated curve-in this case, the cycloid curve-and the obtained fitting curve. Observe that the cycloid curve is better approximated by the fitting curve obtained using the functions f (t) = t 2 and g(t) = 1 − t 2 than by the fitting curve obtained using the functions f (t) = t and g(t) = 1 − t.
Let us see two more approximations of the cycloid. We have taken the following sequence of points s = (s i ) 99 i=0 on the cycloid (15): , y cc ((t i /∆ + 1)π), i = 0, . . . , 99, being the parameters t i = −∆ + 2∆i/99, i = 0, . . . , 99, with 0 < ∆ < π/2. For n = 10, we have approximated the set s by two fitting curves at the vector nodes t = (t i ) 99 i=0 with t i as above. One of the fitting curves is obtained by training the neural network N w,P using the trigonometric functions f (t) = sin ((∆ + t)/2) and g(t) = sin ((∆ − t)/2) and the other one using the hyperbolic functions f (t) = sinh ((∆ + t)/2) and g(t) = sinh ((∆ − t)/2). We can see in Figure 11, the fitting curves and their corresponding fitting error. Let us observe that the cycloid is better approximated by the fitting curve obtained using the hyperbolic functions than the fitting curve obtained using the trigonometric functions.

Archimedean Spiral Curve
Finally, let us show different approximations of the Archimedean spiral given by the parametric equations x sa (t) = t cos(t), t ∈ [0, 4π]. First, let us see an approximation obtained training the neural network N w,P using polynomial functions. We have taken the following sequence of points s = (s i ) 99 i=0 on the Archimedean spiral (16): being the parameters t i = i/99, i = 0, . . . , 99.
For n = 11, we have approximated the set s by the fitting curve using the functions f (t) = t and g(t) = 1 − t at the vector nodes t = (t i ) 99 i=0 with t i as above. Figure 12 shows the fitting curve of degree 11 and its corresponding fitting error. Let us see other examples in which the Archimedean spiral is approximated by the neural network using hyperbolic functions. We have taken the following sequence of points s = (s i ) 99 i=0 on the Archimedean spiral (16): being the parameters t i = −∆ + 2∆i/99, i = 0, . . . , 99. For n = 11, we have approximated the set s by the fitting curve using the functions f (t) = sinh ((∆ + t)/2) and g(t) = sinh ((∆ − t)/2) at the vector nodes t = (t i ) 99 i=0 with t i as above. Figure 13 shows the fitting curve of degree 11 and its corresponding fitting error. We can see in Figure 14, the convergence of the two above fitting curves. Let us observe that the fitting curve corresponding to the hyperbolic rational basis has a faster convergence. Therefore, once again, it seems that the choice of the functions f and g, hence the choice of the rational basis, is relevant to the approximation.

Comparison of Least-Squares Fitting and the Neural Network N w,P
In this section, the proposed neural network is compared with the least-squares method and the regularized least-squares method. It is well known that least-squares fitting is a common procedure to find the best fitting curve to a given set of data points by minimizing the sum of the squares of the data points from the curve ( [9,21,22]). The least-squares method is sensitive to small perturbations in data and, in those cases, regularization methods can be applied such as the regularized least-squares method (see [23]). Therefore, two experiments have been developed. The set of data points used in the first experiment is a non-noisy parametrization of known curves, so the least-squares method has been applied. In the second experiment, we used an image to obtain a noisy set of data points and applied the regularized least-squares method.
The problem that we want to solve is stated as follows. Suppose that f and g are functions defined on [a, b] satisfying the conditions of Proposition 1. Consider a set of parameters a ≤ t 0 < · · · ≤ t ≤ b and a sequence of data points s 0 , . . . , s ∈ R k , where each parameter t i is associated with a data point s i . For some n ≤ , we want to compute a rational curve minimizing the sum of the squares of the deviations from the set of data points s = (s i ) i=0 , that is, In order to compute the control points P = (P i ) n i=0 of the fitting curve, we have to solve, in the least-squares sense, the overdeterminated linear system AP = s, where the matrix A is In this fourth experiment, let us see two examples comparing the fitting curves obtained applying this traditional method and the fitting curves obtained by training the neural network N w,P . We have seen previously an approximation of the circle (14) obtained with the neural network N w,P for n = 5 using the polynomial functions f = t and g = 1 − t, t ∈ [0, 1]. Besides, we have seen an approximation of the Archimedean spiral (16) obtained with the neural network N w,P for n = 11 using the polynomial functions f = t and g = 1 − t, t ∈ [0, 1]. Using the same parameters and sets of data points, we solved the corresponding overdeterminated linear systems AP = s to obtain the control points of the curve that best fits the given data points in the least-squares sense. For this purpose, following the steps shown in Section 6.4 of [1], we have obtained the solutions of AP = s, firstly, by using the Matlab command SVD and, secondly, by using the Matlab command mldivide .
Since the weights are unknown and are necessary for solving the linear system AP = s in the least-squares sense, these have been randomly chosen within a positive range. Let us observe that one of the advantages of the neural network N w,P with respect to the least-squares method is that the neural network N w,P not only finds suitable control points, but it also finds suitable weights to fit the given set of data points.
In Table 3, the execution time of the least-squares method using a different number of weights and control points is provided. We can see that, although for low-degree fitting curves, the least-squares method is faster than the method proposed in this paper, for the fitting curves of degree greater than n = 18, the proposed method is faster than the least-squares method.
We can see in Figures 15 and 16 that the fitting curves obtained by training the neural network are more accurate than the fitting curves obtained by applying the traditional least-squares method.
In the last experiment, we have taken 31 points from a baroque image as a set of data points (see Figure 17). We have approximated them by two fitting curves of degree 8 with hyperbolic functions f (t) = sin ((∆ + t)/2) at the vector nodes t = (t i ) 30 i=0 , such that t i = −∆ + 2∆(i − 1)/30, 0 < ∆ < π/2. The first fitting curve was obtained by training the neural network N w,P during 1000, reaching a final mean absolute error on the set of data points of 9 × 10 −3 . Besides, this example shows the robustness of the proposed method to noisy data points. The second fitting curve was obtained with random vector weights and the regularized least-squares method by using an adaptation of the Matlab library available in [24]. This last fitting curve reached a mean absolute error of 1.95 × 10 −2 . Visually, in Figure 17, it is appreciated that the fitting curve obtained by training the neural network N w,P achieves better curvature than the regularized least-squares method (which is more evident at the beginning and at the end of the curve). Finally, we would like to highlight that we have observed in all the executed experiments a good performance of the neural network for small values of n, in spite of the complexity of the set of data points. Table 3. For different number of weights and control points, the time of execution of the least-squares method using the Matlab commands mldivide and SVD, and the time of execution of the Algorithm 1 for 3000 iterations are provided. The values have been measured in seconds with a set of data points of size 100 and they are the mean of 5 repetitions.

Conlusions and Future Work
In this work, we have tackled the problem of finding a rational curve to fit a given set of data points. To solve this issue, we have proposed a one-hidden-layer neural network based on a general class of totally positive rational bases belonging to spaces mixing algebraic, trigonometric and hyperbolic polynomials, thus expanding the potential range of applications to include more difficult shapes. In order to obtain the weights and control points of the rational curve to fit the data points, the neural network is trained with an optimization algorithm to update the weights and control points while decreasing a loss function. The fitting curves of the numerical experiments show that for certain curves, the use of particular rational bases provides better results.
In future work, we wish to extend the neural network to obtain a suitable parametrization of the data points. The choice of the parameters can help to improve the approximation. Additionally, we plan to apply our method to curves, surfaces and high-dimensional data, and analyze, as in [25] for Bezier curves, its application to industrial software, CAD/CAM systems (such as Blender (https: //www.blender.org/), Maya (https://www.autodesk.es/products/maya/overview) or Solid Edge (https://solidedge.siemens.com/en/)), and other real-world problems. Finally, we plan to explore the applicability of our approach to the resolution of linear differential equations (cf. [26,27]).