Neural network feature processing method and device, equipment, medium and product

By performing linear feature extraction in a convolutional neural network and then using nonlinear transformation of the activation layer and a pre-defined lookup table for fitting, the problem of linear feature extraction being unable to fit complex features is solved, thus improving the accuracy of image classification.

CN121600337APending Publication Date: 2026-03-03XIAN UNISOC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511755776.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Convolutional neural networks, due to their linear feature extraction method, struggle to fit complex nonlinear features in scenarios such as image classification, resulting in low classification accuracy.

Method used

After linear feature extraction from the convolutional layer, nonlinear transformation is performed using the activation layer. Nonlinear features are determined by using a pre-set lookup table and interpolation point fitting, thereby improving the feature processing effect.

Benefits of technology

Nonlinear features obtained through nonlinear transformations have richer details, improving the performance of neural network feature processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121600337A_ABST
    Figure CN121600337A_ABST
Patent Text Reader

Abstract

The invention relates to a neural network feature processing method and apparatus, a device, a medium and a product. The method comprises the steps of obtaining to-be-processed data; performing linear feature extraction on the to-be-processed data to obtain a first feature; performing nonlinear transformation on the first feature based on the activation layer to obtain a second feature; and processing the second feature to obtain a processing result of the to-be-processed data. According to the method, after linear feature extraction is carried out on the to-be-processed data, nonlinear transformation is carried out on the first feature obtained through linear feature extraction by using the activation layer to obtain the second feature, and the second feature is a nonlinear feature and has richer feature details, so that the effect of neural network feature processing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence processing, and in particular to a method, apparatus, device, medium, and product for neural network feature processing. Background Technology

[0002] In the field of convolutional neural network data processing, convolutional layers are usually used to extract features from images. However, the method of feature extraction using convolutional kernels is a linear processing method, which is difficult to fit complex nonlinear features. Therefore, it will lead to poor performance of neural network feature processing. For example, in image classification scenarios, performing only linear feature extraction on images often results in low accuracy of image classification. Summary of the Invention

[0003] Therefore, it is necessary to provide a neural network feature processing method, apparatus, device, medium, and product that can improve the effect of neural network feature processing in response to the above-mentioned technical problems.

[0004] In a first aspect, this application provides a neural network feature processing method, including:

[0005] Obtain the data to be processed;

[0006] Linear feature extraction is performed on the data to be processed to obtain the first feature;

[0007] Based on the activation layer, a nonlinear transformation is performed on the first feature to obtain the second feature;

[0008] The second feature is processed to obtain the processing result of the data to be processed.

[0009] In one embodiment, a second feature is obtained by performing a nonlinear transformation on a first feature based on an activation layer, including: acquiring floating-point attribute data corresponding to the first coordinate components respectively; the first coordinate component is the first feature, and the precision type of the first coordinate component is a preset floating-point type; determining adjacent interpolation points of the fitting point corresponding to the first coordinate component in a preset lookup table based on the floating-point attribute data corresponding to the first coordinate component; wherein the preset lookup table includes multiple interpolation points under a preset floating-point type and a preset activation function; and determining the second coordinate component of the fitting point corresponding to the first coordinate component based on the adjacent interpolation points; wherein the second coordinate component is the corresponding second feature.

[0010] In one embodiment, the floating-point attribute data includes the tail number of the fitted point; correspondingly, determining the second coordinate component of the fitted point corresponding to the first coordinate component based on adjacent interpolation points includes: searching for interpolation point data corresponding to adjacent interpolation points in a preset lookup table; wherein, the interpolation point data includes the tail number of the interpolation point, the activation value of the interpolation point, and the slope of the interpolation point; and determining the second coordinate component of the fitted point based on at least one of the tail number of the fitted point, the tail number of the interpolation point, the slope of the interpolation point, and the activation value of the interpolation point.

[0011] In one embodiment, determining the second coordinate component of a fitted point based on at least one of the tail number of fitted points, the tail number of interpolation points, the slope of interpolation points, and the activation value of interpolation points includes: determining the difference between a first coordinate component and an adjacent interpolation point based on the tail number of fitted points and the tail number of interpolation points; determining the difference between a second coordinate component and an adjacent interpolation point based on the difference between the first coordinate component and the slope of interpolation points; and determining the second coordinate component of the fitted point based on the difference between the second coordinate component and the activation value of interpolation points.

[0012] In one embodiment, the method further includes: adjusting the number of interpolation points under at least one interpolation point exponent in a preset lookup table according to the curvature distribution of a preset activation function.

[0013] In one embodiment, adjusting the number of interpolation points under at least one interpolation point index in a preset lookup table according to the curvature distribution of a preset activation function includes: obtaining a first coordinate component range in the fitting result whose curvature is greater than a preset curvature; determining the corresponding first interpolation point index range based on the first coordinate component range; increasing the number of interpolation points under each interpolation point index in the first interpolation point index range; and / or decreasing the number of interpolation points under each interpolation point index in other preset index ranges outside the first interpolation point index range.

[0014] Secondly, this application also provides a neural network feature processing device, comprising:

[0015] The data acquisition module is used to acquire the data to be processed.

[0016] The first extraction module is used to perform linear feature extraction on the data to be processed to obtain the first feature;

[0017] The second extraction module is used to perform a nonlinear transformation on the first feature based on the activation layer to obtain the second feature;

[0018] The feature processing module is used to process the second feature to obtain the processing result of the data to be processed.

[0019] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method provided in the first aspect.

[0020] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect.

[0021] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the method provided in the first aspect.

[0022] The aforementioned neural network feature processing methods, devices, equipment, media, and products, after performing linear feature extraction on the data to be processed, utilize activation layers to perform nonlinear transformation on the first feature obtained from the linear feature extraction to obtain a second feature. Since the second feature is a nonlinear feature, it has richer details, thus improving the effect of neural network feature processing. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart illustrating a neural network feature processing method in one embodiment;

[0025] Figure 2A This is a flowchart illustrating the nonlinear transformation steps in one embodiment;

[0026] Figure 2B This is a schematic diagram of a preset floating-point data format in one embodiment;

[0027] Figure 2C This is a schematic diagram of a preset activation function in one embodiment;

[0028] Figure 3 This is a flowchart illustrating the steps for determining adjacent interpolation points in one embodiment;

[0029] Figure 4A This is a flowchart illustrating the second coordinate component determination step in one embodiment;

[0030] Figure 4B This is a schematic diagram showing the distribution of interpolation points in a preset interpolation table in one embodiment;

[0031] Figure 4C This is a schematic diagram of a linear calculation method in one embodiment;

[0032] Figure 5 This is a flowchart illustrating the second coordinate component determination step in one embodiment;

[0033] Figure 6 This is a flowchart illustrating the steps for adjusting the number of interpolation points in one embodiment;

[0034] Figure 7A This is a flowchart illustrating the steps for adjusting the number of interpolation points in one embodiment;

[0035] Figure 7B This is a schematic diagram showing the distribution of interpolation points in the initial preset lookup table of one embodiment;

[0036] Figure 7C This is a schematic diagram of the distribution of interpolation points in the adjusted preset lookup table in one embodiment;

[0037] Figure 8 This is a block diagram of a neural network feature processing device in one embodiment;

[0038] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0040] In one exemplary embodiment, a neural network feature processing method is provided, see [link to example]. Figure 1 The method includes:

[0041] S110, Obtain the data to be processed.

[0042] In image classification scenarios, the data to be processed consists of images to be classified. For example, classifying images based on the types of animals they contain.

[0043] S120, perform linear feature extraction on the data to be processed to obtain the first feature.

[0044] In this process, convolutional layers can be used to extract linear features from the data to be processed. More specifically, convolutional layers can use convolutional kernels of a preset size to extract linear features from the data to be processed.

[0045] S130, based on the activation layer, performs a nonlinear transformation on the first feature to obtain the second feature.

[0046] Specifically, a preset activation function can be used to perform a nonlinear transformation on the first feature. The preset activation function is a nonlinear function.

[0047] Of course, in real-world scenarios, there may be multiple network units, each containing a convolutional layer and an activation layer. Linear feature extraction is performed through the convolutional layer, and non-linear feature extraction through the activation layer. Multiple network units are connected in series to achieve multiple feature extractions of the data to be processed. The final features are then processed to obtain the final result.

[0048] S140, process the second feature to obtain the processing result of the data to be processed.

[0049] For example, by inputting the second feature of the image to be classified into a fully connected layer, the classification result of the image can be obtained.

[0050] The aforementioned neural network feature processing method, after performing linear feature extraction on the data to be processed, performs a nonlinear transformation on the first feature based on the activation layer to obtain the second feature. Since the second feature is a nonlinear feature, it has richer feature details, thus improving the effect of neural network feature processing.

[0051] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided. In this optional embodiment, the nonlinear transformation step in S130 is refined.

[0052] See Figure 2A The refined nonlinear transformation steps include:

[0053] S210, obtain the floating-point attribute data corresponding to the first coordinate components respectively; the first coordinate component is the first feature, and the precision type of the first coordinate component is a preset floating-point type.

[0054] The first coordinate component is, for example, the component x on the horizontal axis. The second coordinate component is, for example, the component y on the vertical axis. In this embodiment, the first coordinate component is a first feature of a preset floating-point type, and the second coordinate component is a second feature corresponding to the first feature.

[0055] Understandably, if the first feature is directly converted into the second feature using a preset activation function, the calculation process is complex and time-consuming, especially if the preset activation function is complex and the first feature is a floating-point type. Therefore, the second feature corresponding to the first feature is determined by fitting.

[0056] For ease of understanding, the coordinate data formed by the first and second coordinate components is taken as a fitting point. At this fitting point, the first coordinate component is known, while the second coordinate component is unknown. Therefore, the second coordinate component needs to be obtained through fitting.

[0057] The preset floating-point type can be a half-precision floating-point type, a single-precision floating-point type, or a double-precision floating-point type. Of course, it can also be other types, which are not limited here.

[0058] Here, the fitting point is the coordinate point required to fit the activation function.

[0059] The floating-point attribute data can include the exponent, sign bit, and mantissa. To distinguish it from the attribute data of the interpolation point, the exponent in the floating-point attribute data of the fitting point is called the fitting point exponent, the sign bit is called the fitting point sign bit, and the mantissa is called the fitting point mantissa.

[0060] See Figure 2B The first coordinate component of the preset floating-point type includes three parts: the sign bit of the fitted point, the exponent of the fitted point, and the mantissa of the fitted point. For half-precision floating-point type, the bit width of the fitted point exponent is 5 bits, and the bit width of the fitted point mantissa is 10 bits; for single-precision floating-point type, the bit width of the fitted point exponent is 8 bits, and the bit width of the fitted point mantissa is 23 bits; for double-precision floating-point type, the bit width of the fitted point exponent is 11 bits, and the bit width of the fitted point mantissa is 52 bits.

[0061] S220, Based on the floating-point attribute data corresponding to the first coordinate component, determine the adjacent interpolation points of the fitting point corresponding to the first coordinate component in the preset lookup table.

[0062] The preset lookup table includes multiple interpolation points under preset floating-point types and preset activation functions. It is evident that different preset floating-point types and / or different preset activation functions correspond to different preset lookup tables.

[0063] The preset lookup table includes multiple interpolation point data entries. The number of interpolation point data entries is the lookup table depth. Each interpolation point data entry corresponds to one interpolation point. Each interpolation point data entry includes the component of the interpolation point on the horizontal axis, the component on the vertical axis (also called the activation value), the exponent, the mantissa, the sign bit, and the slope. To distinguish it from the floating-point attribute data of the fitted points, the exponent of the interpolation point is called the interpolation point exponent, the mantissa is called the interpolation point mantissa, the sign bit is called the interpolation point sign bit, and the slope is called the interpolation point slope.

[0064] The adjacent interpolation point can be the interpolation point that is closest to the fitting point to the left of the fitting point in the preset lookup table. Alternatively, it can be the interpolation point that is closest to the fitting point to the right of the fitting point in the preset lookup table.

[0065] The relationship between the input data x of the preset activation function, the exponent E of x, the sign bit S of x, and the mantissa m of x can be expressed as:

[0066]

[0067] In the formula, S is 0 when x is positive and 1 when x is negative; wid_e represents the bit width of E; wid_m represents the bit width of m. Therefore, the above relationship can be used to determine the exponent, mantissa, and sign bit of the fitting point for the first coordinate component. Of course, other methods can also be used to determine the exponent, mantissa, and sign bit of the fitting point for the first coordinate component, which are not limited here.

[0068] S230, based on adjacent interpolation points, determine the second coordinate component of the fitted point corresponding to the first coordinate component.

[0069] One method is linear interpolation, where the second coordinate component of the fitted point corresponding to the first coordinate component is determined based on adjacent interpolation points. Other methods can also be used to determine the second coordinate component.

[0070] Understandably, after determining the corresponding second coordinate component for a fitted point, the first and second coordinate components form the coordinate data of that fitted point. For multiple fitted points, multiple corresponding coordinate data can be obtained. Based on the coordinate data of these fitted points, a curve is plotted in the coordinate system, and the resulting curve is close to the curve of the preset activation function.

[0071] Understandably, see Figure 2C Preset activation functions have two properties: the function changes complexly when the input data is near 0; and when the input approaches ±∞, the function value approaches a constant a (e.g., 0, 1, -1) or kx, exhibiting simple linearity. Examples include the Swish activation function or the tanh activation function, and other activation functions that conform to these two properties, thus they can also be applied to nonlinear feature processing scenarios.

[0072] In this embodiment, when the input data for the preset activation function is a preset floating-point type, a corresponding preset lookup table is set for the preset activation function and the preset floating-point type. This lookup table contains multiple interpolation points. The floating-point attribute data corresponding to the first coordinate component is obtained, and a search is performed in the lookup table based on this floating-point attribute data to obtain adjacent interpolation points. Based on these adjacent interpolation points, the corresponding second coordinate component, i.e., the second feature, can be determined. Thus, the complex function calculation process is transformed into a simple fitting process, achieving fast nonlinear processing of the first feature of the preset floating-point type, thereby improving the efficiency of neural network feature processing.

[0073] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided. In this optional embodiment, the step of determining adjacent interpolation points in S220 is refined.

[0074] See Figure 3 The refined steps for determining adjacent interpolation points include:

[0075] S310, determine the index address corresponding to the adjacent interpolation point in the preset lookup table based on at least one of the following: the exponent of the fitted point, the mantissa of the fitted point, and the sign bit of the fitted point.

[0076] Where S=1 and In this case, the index address can be calculated using the following first calculation formula:

[0077]

[0078] Where S=0 and In this case, the index address can be calculated using the following second formula:

[0079]

[0080] In the formula, The index address of the adjacent interpolation point; wid_e represents the bit width of the fitting point exponent; N is the number of interpolation points under each exponent in the preset lookup table; E is the fitting point exponent; m is the mantissa of the fitting point; wid_m represents the bit width of the mantissa of the fitting point; S is the sign bit of the fitting point, S is 0 or 1.

[0081] As can be seen, the index address is calculated using the appropriate formula based on whether the sign bit of the fitted point is 0 or 1. Of course, other methods can also be used to calculate the index address, which are not limited here.

[0082] S320, determine the adjacent interpolation points based on the index address.

[0083] Understandably, after obtaining the index address, the interpolation point corresponding to that index address can be used as the adjacent interpolation point.

[0084] In this embodiment, in the process of determining the index address corresponding to the adjacent interpolation point, at least one of the fitting point exponent, fitting point mantissa, and fitting point sign bit is considered, that is, the index address is calculated based on the floating-point attribute data of the fitting point, so that the index address corresponding to the adjacent interpolation point can be accurately calculated, and then the adjacent interpolation point can be accurately found from the preset lookup table according to the index address.

[0085] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided. In this optional embodiment, the step of determining the second coordinate component in S230 is refined.

[0086] See Figure 4A The detailed steps for determining the second coordinate components include:

[0087] S410, search for the interpolation point data corresponding to the adjacent interpolation point in the preset lookup table.

[0088] The interpolation point data includes the number of interpolation points, the activation value of the interpolation point, and the slope of the interpolation point.

[0089] Of course, in addition to the interpolation point mantissa, interpolation point activation value, and interpolation point slope, the interpolation point data can also include the interpolation point exponent and the components of the interpolation point on the horizontal axis.

[0090] See Table 1 below, which is a preset lookup table with a preset floating-point type of fp16 precision and a preset activation function of Swish activation function. The depth of the lookup table is 256.

[0091] Table 1 Preset Lookup Table

[0092]

[0093] The Swish activation function is expressed as follows:

[0094]

[0095] In the formula, Here are the learnable parameters, and x is the input data.

[0096] As shown in Table 1 above, there are a total of 248 interpolation points for all normalized and non-normalized input data. The remaining 8 interpolation points are assigned to special numbers such as ±∞ and NaN. The distribution of the 256 interpolation points is shown in [reference needed]. Figure 4B ,from Figure 4B As can be seen, the Swish activation function has a large curvature near 0, and there are many interpolation points near 0. As the Swish activation function approaches stability as the input data approaches ±∞, the number of interpolation points also decreases. This achieves the distribution of more interpolation points in regions with complex activation value changes. Such interpolation point distribution helps to improve the subsequent fitting accuracy.

[0097] The preset lookup table shown in Table 1 above can be constructed based on the following expression:

[0098]

[0099] In the formula, The x-values ​​of the interpolation points in the preset lookup table are defined as follows: depth is the depth of the preset lookup table; N is the number of interpolation points under each exponent; wid_m represents the bit width of the tail of the fitted points; and depth / 2+n is the index address.

[0100] S420, determine the second coordinate component of the fitted point based on at least one of the following: the number of fitted points, the number of interpolation points, the slope of the interpolation point, and the activation value of the interpolation point.

[0101] That is, based on the floating-point attribute data of the fitted point and the relevant information of the interpolation point, the second coordinate component of the fitted point is calculated. There are various specific calculation methods, such as linear calculation, and other calculation methods can also be selected, which are not limited here.

[0102] See Figure 4C The principle of linear calculation includes: the slope of the interpolation point (x0, y0) is: k = (y1 - y0) / (x1 - x0), where the interpolation point (x1, y1) is the next interpolation point after the interpolation point (x0, y0). Therefore, if the interpolation point (x0, y0) is taken as the adjacent interpolation point to the left of the fitted point, then the second coordinate component of the fitted point is y = y0 + k × (x - x0). .

[0103] In one alternative implementation, see Figure 5 The steps for determining the second coordinate component in S420 include:

[0104] S510, determine the first coordinate component difference between the fitted point and the adjacent interpolation point based on the tail number of the fitted point and the tail number of the interpolation point.

[0105] The difference between the tail number of the fitted points and the tail number of the interpolated points is obtained as the first coordinate component difference.

[0106] S520, based on the first coordinate component difference and the slope of the interpolation point, determine the second coordinate component difference between the fitted point and the adjacent interpolation point.

[0107] The difference between the first coordinate components is multiplied by the slope of the interpolation point to obtain the difference between the second coordinate components.

[0108] S530, determine the second coordinate component of the fitted point based on the difference between the second coordinate components and the activation value of the interpolation point.

[0109] In the case where the adjacent interpolation point is the interpolation point closest to the left side of the preset interpolation table, the difference of the second coordinate component and the activation value of the interpolation point are summed to obtain the second coordinate component of the fitting point.

[0110] In the case where the adjacent interpolation point is the closest interpolation point in the preset interpolation table, the difference between the interpolation point activation value and the second coordinate component is calculated to obtain the second coordinate component of the fitted point.

[0111] The above implementation method is based on linear calculation to calculate the second coordinate component of the fitted point. The calculation method is simple and fast, which can improve the fitting efficiency.

[0112] Of course, the above linear calculation method assumes that the first coordinate component of the fitted point is not a special point. The data type of the first coordinate component includes special points, normalized numbers, and non-normalized numbers. Normalized numbers and non-normalized numbers can be collectively referred to as finite value types. Therefore, when the second coordinate component is a finite value type, the second coordinate component is determined according to the above linear calculation method. Special points are data where the fitted point exponent is 31, or where the fitted point exponent is 30 but the tail of the fitted point is the maximum value (e.g., 1023). When the first coordinate component is a special point, the activation value in the interpolation point data corresponding to the index address can be directly used as the second coordinate component of the fitted point.

[0113] In this embodiment, by searching for the interpolation point data corresponding to adjacent interpolation points in a preset lookup table, the second coordinate component of the fitted point can be quickly calculated based on the interpolation point data and the floating-point attribute data of the fitted point.

[0114] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided. In this optional embodiment, the fitting step is refined to include an interpolation point number adjustment step.

[0115] See Figure 6 The steps for adjusting the number of interpolation points include:

[0116] S610, based on the curvature distribution of the preset activation function, adjust the number of interpolation points under at least one interpolation point exponent in the preset lookup table.

[0117] Understandably, in the initial preset lookup table, apart from the interpolation point data where the special point is located, the number of interpolation points corresponding to each interpolation point exponent is the same. For example, the number of interpolation points under each interpolation point exponent is 4.

[0118] In the initial preset lookup table, the number of interpolation points corresponding to each interpolation point exponent, excluding the interpolation point data containing special points, can be determined based on the depth of the preset lookup table, the number of special points, and the number of interpolation point exponents: Number of interpolation points corresponding to each interpolation point exponent = (depth of preset lookup table - number of special points) / (2 × number of interpolation point exponents). For example, for the preset floating-point type fp16, the depth of the preset lookup table is 256, the number of special points is 8, and the number of interpolation point exponents is 31; therefore, the number of interpolation points corresponding to each interpolation point exponent is 4.

[0119] Because the preset activation function has different curvatures at different locations—some with larger curvatures and others with smaller curvatures—the fitting accuracy at locations with larger curvatures may be lower. To improve the fitting accuracy at locations with larger curvatures, more interpolation points can be set there. Therefore, the preset lookup table can be adjusted based on the curvature distribution of the preset activation function. This adjustment involves changing the number of interpolation points under the interpolation point exponent, increasing the density of interpolation points at locations with larger curvatures in the adjusted lookup table. Refitting using the adjusted lookup table further improves the fitting accuracy at locations with larger curvatures.

[0120] In one alternative implementation, see Figure 7A The steps for adjusting the number of interpolation points in S610 may specifically include:

[0121] S710, obtain the range of the first coordinate component whose curvature is greater than the preset curvature in the curvature distribution.

[0122] For example, see Figure 7B The distribution of interpolation points in the initial lookup table corresponding to the tanh activation function shows a large curvature near the x-coordinate of 1.0. The maximum error in linear calculations occurs around 1.0, so increasing the number of interpolation points near 1.0 can improve subsequent fitting accuracy. In this case, the region [0.5, 2] containing 1.0 can be used as the range of the first coordinate component. For the centrally symmetric activation function, [-2, -0.5] is also used as the range of the first coordinate component.

[0123] The tanh activation function can be expressed as:

[0124]

[0125] In the formula, x is the input data of the activation function.

[0126] S720, determine the corresponding first interpolation point exponent range based on the range of the first coordinate components.

[0127] For example, the interpolation point exponent range corresponding to the region [0.5,2] is [12,18], therefore the first interpolation point exponent range is [12,18].

[0128] S730, increase the number of interpolation points under each interpolation point exponent in the first interpolation point exponent range, and / or decrease the number of interpolation points under each interpolation point exponent in other preset exponent ranges outside the first interpolation point exponent range.

[0129] For example, the number of interpolation points under the exponent of each interpolation point in the range [12, 18] is increased to 8. Other preset exponent ranges can be the exponent range [0, 11] corresponding to the range where the absolute value of x is less than 0.5. The number of interpolation points under the exponent of each interpolation point in the exponent range [0, 11] is reduced to 1 or 0. This achieves the adjustment of the preset lookup table for the tanh activation function. The distribution of each interpolation point after the adjustment is shown in [reference]. Figure 7C As shown, from Figure 7C As can be seen, the density of interpolation points increases at locations with greater curvature, which can improve the fitting accuracy at locations with greater curvature.

[0130] As can be seen, dividing the exponents of each interpolation point into different ranges, which can also be called regions, allows for adjustments to the preset lookup table. Within the same region, the number of interpolation points under each exponent is the same, while the number of interpolation points under each exponent in different regions can be the same or different. In other words, by adjusting the number of interpolation points under each exponent in one or more regions, the density distribution of interpolation points can be adjusted.

[0131] In the above implementation, for the first interpolation point exponent range corresponding to the first coordinate component range with curvature greater than the preset curvature, the preset lookup table can be adjusted by increasing the number of interpolation points under each interpolation point exponent in the first interpolation point exponent range, or by decreasing the number of interpolation points under each interpolation point exponent in other preset exponent ranges outside the first interpolation point exponent range. Using the adjusted preset lookup table for fitting again can improve the fitting accuracy of subsequent steps.

[0132] In this embodiment, the preset lookup table is adjusted according to the curvature distribution of the preset activation function, so that the adjusted preset lookup table can be used for fitting, which can meet higher fitting requirements under the condition of limited hardware resources.

[0133] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided. In this optional embodiment, the floating-point attribute data acquisition step in S210 is refined. The refined floating-point attribute data determination step includes any one of the following:

[0134] (1) When the preset activation function has a first restriction on the range of values ​​of the input data, clamp each first coordinate component according to the first restriction and obtain the floating-point attribute data corresponding to the first coordinate component respectively.

[0135] (2) When the preset activation function does not have a first restriction on the range of values ​​of the input data, obtain the floating-point attribute data corresponding to the first coordinate components respectively.

[0136] For example, if the preset activation function requires that the input data cannot exceed a preset maximum value and cannot be less than a preset minimum value, then the first coordinate component of the fitted point can be used for clamping. Clamping can be understood as setting the first coordinate component to the preset maximum value if it is greater than the preset maximum value, and setting it to the preset minimum value if it is less than the preset minimum value. After clamping, the clamped first coordinate component is then used for subsequent floating-point attribute data acquisition steps.

[0137] Of course, if the preset activation function does not have requirements on the range of values ​​of the input data, there is no need to perform clamping processing, and the first coordinate component can be directly used for subsequent floating-point attribute data acquisition steps.

[0138] In this embodiment, the first coordinate component is clamped based on whether the preset activation function has a limiting condition on the range of values ​​of the input data, thereby ensuring that the first coordinate component can be processed correctly in the future.

[0139] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided. In this optional embodiment, after the nonlinear processing in S230, the following steps are further performed:

[0140] (1) When the preset activation function has a second restriction on the range of values ​​of the output data, the second coordinate component is clamped according to the second restriction, and the clamped second coordinate component is used as the second feature.

[0141] Of course, if the preset activation function does not have a second restriction on the range of values ​​of the output data, the second coordinate component is directly used as the second feature.

[0142] For example, if the preset activation function has requirements on the range of output data values, such as requiring the output data not to be greater than a preset maximum value and not to be less than a preset minimum value, then the second coordinate component is clamped. That is, if the second coordinate component is greater than the preset maximum value, the second coordinate component is set to the preset maximum value; if the second coordinate component is less than the preset minimum value, the second coordinate component is set to the preset minimum value. After clamping, the clamped second coordinate component is used as the second feature.

[0143] In this embodiment, the decision to clamp the second coordinate component is made based on whether the preset activation function has any restrictions on the range of values ​​of the output data, thereby ensuring the rationality of the second feature.

[0144] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0145] Based on the same inventive concept, this application also provides a neural network feature processing apparatus for implementing the neural network feature processing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more neural network feature processing apparatus embodiments provided below can be found in the limitations of the neural network feature processing method described above, and will not be repeated here.

[0146] In one exemplary embodiment, a neural network feature processing apparatus is provided, see [link to relevant documentation]. Figure 8 The device includes: a data acquisition module 810, a first extraction module 820, a second extraction module 830, and a feature processing module 840, wherein:

[0147] Data acquisition module 810 is used to acquire data to be processed;

[0148] The first extraction module 820 is used to perform linear feature extraction on the data to be processed to obtain the first feature;

[0149] The second extraction module 830 is used to perform a nonlinear transformation on the first feature based on the activation layer to obtain the second feature;

[0150] The feature processing module 840 is used to process the second feature to obtain the processing result of the data to be processed.

[0151] In one embodiment, the second extraction module includes: a first acquisition unit, configured to acquire floating-point attribute data corresponding to the first coordinate components respectively; the first coordinate component is the first feature, and the precision type of the first coordinate component is a preset floating-point type; a first determination unit, configured to, for each first coordinate component, determine adjacent interpolation points of the fitting point corresponding to the first coordinate component in a preset lookup table based on the floating-point attribute data corresponding to the first coordinate component; wherein the preset lookup table includes multiple interpolation points under a preset floating-point type and a preset activation function; and a second determination unit, configured to determine the second coordinate component of the fitting point corresponding to the first coordinate component based on the adjacent interpolation points; wherein the second coordinate component is the corresponding second feature.

[0152] In one embodiment, the floating-point attribute data includes the tail number of the fitted point; correspondingly, the second determining unit includes: a first lookup subunit, used to look up interpolation point data corresponding to adjacent interpolation points in a preset lookup table; wherein, the interpolation point data includes the tail number of the interpolation point, the activation value of the interpolation point, and the slope of the interpolation point; the first determining subunit is used to determine the second coordinate component of the fitted point based on at least one of the tail number of the fitted point, the tail number of the interpolation point, the slope of the interpolation point, and the activation value of the interpolation point.

[0153] In one embodiment, the first determining subunit is specifically used to: determine the first coordinate component difference between the fitted point and the adjacent interpolation point based on the tail number of the fitted point and the tail number of the interpolation point; determine the second coordinate component difference between the fitted point and the adjacent interpolation point based on the first coordinate component difference and the slope of the interpolation point; and determine the second coordinate component of the fitted point based on the second coordinate component difference and the activation value of the interpolation point.

[0154] In one embodiment, the function fitting module further includes a lookup table adjustment module, used to adjust the number of interpolation points under at least one interpolation point exponent in the preset lookup table according to the curvature distribution of the preset activation function.

[0155] In one embodiment, the lookup table adjustment module is specifically used to: obtain the range of first coordinate components in the fitting result whose curvature is greater than a preset curvature; determine the corresponding first interpolation point exponent range based on the first coordinate component range; increase the number of interpolation points under each interpolation point exponent in the first interpolation point exponent range, and / or decrease the number of interpolation points under each interpolation point exponent in other preset exponent ranges outside the first interpolation point exponent range.

[0156] In one embodiment, the floating-point attribute data includes the fitting point exponent, the fitting point mantissa, and the fitting point sign bit; correspondingly, the first determining unit is specifically used to: determine the index address corresponding to the adjacent interpolation point in the preset lookup table based on at least one of the fitting point exponent, the fitting point mantissa, and the fitting point sign bit; and determine the adjacent interpolation point based on the index address.

[0157] Each module in the aforementioned neural network feature processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0158] In one exemplary embodiment, a computer device is provided, the internal structure of which can be as shown in the figure. Figure 9 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a neural network feature processing method.

[0159] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0160] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the neural network feature processing methods provided in the above embodiments.

[0161] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the neural network feature processing methods provided in the above embodiments.

[0162] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the neural network feature processing methods provided in the above embodiments.

[0163] The neural network feature processing methods provided in the above embodiments can be executed by a chip or a chip module; the neural network feature processing devices provided in the above embodiments can be chips or chip modules. Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for various devices and products applied to or integrated into a chip, all included modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs running on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits; for various devices and products applied to or integrated into a chip module, all included modules / units can be implemented using hardware methods such as circuits, and different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The components can be implemented using software programs that run on the processor integrated within the chip module. The remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the terminal, each of its components / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or in different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.

[0164] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0165] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0166] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0167] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A neural network feature processing method, characterized in that, include: Obtain the data to be processed; Linear feature extraction is performed on the data to be processed to obtain the first feature; Based on the activation layer, a nonlinear transformation is performed on the first feature to obtain the second feature; The second feature is processed to obtain the processing result of the data to be processed.

2. The method according to claim 1, characterized in that, The step of performing a nonlinear transformation on the first feature based on the activation layer to obtain the second feature includes: Obtain the floating-point attribute data corresponding to the first coordinate components respectively; the first coordinate component is the first feature, and the precision type of the first coordinate component is a preset floating-point type; Based on the floating-point attribute data corresponding to the first coordinate component, determine the adjacent interpolation points of the fitting point corresponding to the first coordinate component in a preset lookup table; wherein, the preset lookup table includes multiple interpolation points under the preset floating-point type and preset activation function; and Based on the adjacent interpolation points, determine the second coordinate component of the fitting point corresponding to the first coordinate component; wherein, the second coordinate component is the corresponding second feature.

3. The method according to claim 2, characterized in that, The floating-point attribute data includes the tail number of the fitted point; correspondingly, determining the second coordinate component of the fitted point corresponding to the first coordinate component based on the adjacent interpolation points includes: The interpolation point data corresponding to the adjacent interpolation points is searched in the preset lookup table; wherein, the interpolation point data includes the interpolation point tail number, the interpolation point activation value, and the interpolation point slope; The second coordinate component of the fitted point is determined based on at least one of the following: the tail number of the fitted point, the tail number of the interpolation point, the slope of the interpolation point, and the activation value of the interpolation point.

4. The method according to claim 3, characterized in that, Determining the second coordinate component of the fitted point based on at least one of the following: the tail number of the fitted point, the tail number of the interpolation point, the slope of the interpolation point, and the activation value of the interpolation point, includes: The first coordinate component difference between the fitted point and the adjacent interpolation point is determined based on the tail number of the fitted point and the tail number of the interpolation point. The second coordinate component difference between the fitted point and the adjacent interpolation point is determined based on the first coordinate component difference and the interpolation point slope. The second coordinate component of the fitted point is determined based on the difference between the second coordinate components and the activation value of the interpolation point.

5. The method according to claim 2, characterized in that, The method further includes: Based on the curvature distribution of the preset activation function, the number of interpolation points under at least one interpolation point exponent in the preset lookup table is adjusted.

6. The method according to claim 5, wherein adjusting the number of interpolation points under at least one interpolation point exponent in the preset lookup table according to the curvature distribution of the preset activation function includes: Obtain the range of the first coordinate component whose curvature is greater than a preset curvature in the curvature distribution; Based on the range of the first coordinate components, determine the corresponding range of the first interpolation point exponent; Increase the number of interpolation points under each interpolation point exponent in the first interpolation point exponent range, and / or decrease the number of interpolation points under each interpolation point exponent in other preset exponent ranges outside the first interpolation point exponent range.

7. A neural network feature processing device, characterized in that, include: The data acquisition module is used to acquire the data to be processed. The first extraction module is used to perform linear feature extraction on the data to be processed to obtain a first feature; The second extraction module is used to perform a nonlinear transformation on the first feature based on the activation layer to obtain the second feature; The feature processing module is used to process the second feature to obtain the processing result of the data to be processed.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.