Neural network model construction method and device, computer equipment and storage medium

The neural network parameter values ​​are obtained and stored through the configuration interface, and the network layer structure is automatically configured, the parameter values ​​are dynamically bound to generate network layer creation logic, and finally the neural network model is built through the network construction class, solving the complex and time-consuming problem of the construction process. , realizes efficient model construction and scalability.

CN119476420AInactive Publication Date: 2025-02-18WUXI JINGSHI INCUBATION MANAGEMENT CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411772729.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-02-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Device model engineers are not good at programming when building neural network models, which makes the process complex and time-consuming. How to simplify the construction process and improve efficiency has become a technical challenge.

Method used

Provide a neural network model construction method, obtain and store neural network parameter values ​​through the configuration interface, and automatically configure the network layer structure according to the structural configuration parameters, dynamically bind parameter values ​​to generate network layer creation logic, and finally build neural network construction classes through network construction classes. Network model.

Benefits of technology

The construction process of neural network models is simplified, the model construction efficiency is improved, and device model engineers can flexibly adjust neural network parameters without manually modifying the underlying code, ensuring the scalability and flexibility of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476420A_ABST
    Figure CN119476420A_ABST
Patent Text Reader

Abstract

The invention relates to a neural network model construction method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring a selection operation on a neural network parameter value to be selected in a neural network parameter option component on a configuration interface, and storing the selected neural network parameter value; obtaining structure configuration parameters on the configuration interface, and performing network layer structure configuration according to the structure configuration parameters; configuring the network layer according to the network layer configuration data and the stored neural network parameter value to obtain a creation logic of the network layer; and creating a network construction class, and constructing a neural network model through the network construction class according to the stored neural network parameter value, the configured network layer structure and the creation logic of the network layer. By adopting the method, the construction process of the neural network model can be simplified, and the model construction efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of device modeling technology, and in particular to a neural network model construction method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] With its powerful learning ability, neural network models are gradually being widely used in the field of device modeling. In the application of neural network models in the field of device modeling, device model engineers need to build neural network models through programming. However, device model engineers are usually not good at programming, which makes the process of building neural network models complicated and time-consuming. Therefore, how to simplify the process of building neural network models and improve the efficiency of model building has become a technical problem that needs to be solved. Summary of the invention

[0003] Based on this, it is necessary to provide a neural network model construction method, device, computer equipment and storage medium that can simplify the construction process of the neural network model and improve the efficiency of model construction in response to the above technical problems.

[0004] In a first aspect, the present application provides a method for constructing a neural network model, comprising:

[0005] Obtaining a selection operation for a neural network parameter value to be selected in a neural network parameter option component on a configuration interface, and storing the selected neural network parameter value;

[0006] Obtain structure configuration parameters in the configuration interface, and configure the network layer structure according to the structure configuration parameters;

[0007] The network layer is configured according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer;

[0008] Create a network construction class, and use the network construction class to build a neural network model based on the stored neural network parameter values, the configured network layer structure, and the creation logic of the network layer.

[0009] In one embodiment, the neural network parameter option component includes a plurality of neural network parameter option components, each of which is used to display a plurality of candidate neural network parameter values ​​corresponding to a neural network parameter;

[0010] Among them, the neural network parameter option component includes an activation function option component, a neuron number option component, a neural network layer number option component, a step size option component, a loss function option component and a learning rate option component.

[0011] In one embodiment, obtaining a selection operation of a neural network parameter value to be selected in a neural network parameter option component in a configuration interface and storing the selected neural network parameter value includes:

[0012] In the configuration interface, through the event monitoring device corresponding to the neural network parameter option component, the selection operation of the neural network parameter value to be selected in the neural network parameter option component is obtained, and the selected neural network parameter value is obtained according to the selection operation;

[0013] Update the storage structure according to the selected neural network parameter values.

[0014] In one embodiment, obtaining structure configuration parameters in a configuration interface, and performing network layer structure configuration according to the structure configuration parameters include:

[0015] Create a custom class in the configuration interface, and configure the common attribute data and common behavior data of the network layer through the custom class;

[0016] The input parameters of each network layer are obtained on the configuration interface, the input parameters of each network layer are determined as the structural configuration parameters of the network layer, and the structure of each network layer is configured according to the structural configuration parameters of each network layer.

[0017] In one embodiment, configuring the structure of each network layer according to the structure configuration parameters of each network layer includes:

[0018] For the linear layer, the structure of the linear layer is configured according to the structural configuration parameters of the linear layer: the multiplication operation of the structural configuration parameters of the linear layer and the weight matrix is ​​combined with the bias term to complete the forward propagation;

[0019] For the convolution layer, the structure of the convolution layer is configured according to the structural configuration parameters of the convolution layer: a convolution operation is performed on the structural configuration parameters of the convolution layer through a convolution kernel.

[0020] In one of the embodiments, the network layer configuration data includes a type identifier of the network layer and an operation configuration parameter of the network layer;

[0021] The network layer is configured according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer, including:

[0022] Selecting a corresponding network layer object according to the type identifier of the network layer, and instantiating the network layer object to obtain a network layer instance;

[0023] The network layer instance is configured according to the operation configuration parameters of the network layer to obtain the configured network layer instance;

[0024] Dynamically bind the stored neural network parameter values ​​to the configured network layer instance to obtain the creation logic of the network layer.

[0025] In a second aspect, the present application also provides a neural network model construction device, comprising:

[0026] A parameter selection module is used to obtain the selection operation of the neural network parameter value to be selected in the neural network parameter option component in the configuration interface, and store the selected neural network parameter value;

[0027] The structure configuration module is used to obtain the structure configuration parameters in the configuration interface and perform network layer structure configuration according to the structure configuration parameters;

[0028] The network layer configuration module is used to configure the network layer according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer;

[0029] The model building module is used to create a network building class. The network building class builds a neural network model according to the stored neural network parameter values, the configured network layer structure and the creation logic of the network layer.

[0030] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0031] Obtaining a selection operation for a neural network parameter value to be selected in a neural network parameter option component on a configuration interface, and storing the selected neural network parameter value;

[0032] Obtain structure configuration parameters in the configuration interface, and configure the network layer structure according to the structure configuration parameters;

[0033] The network layer is configured according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer;

[0034] Create a network construction class, and use the network construction class to build a neural network model based on the stored neural network parameter values, the configured network layer structure, and the creation logic of the network layer.

[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:

[0036] Obtaining a selection operation for a neural network parameter value to be selected in a neural network parameter option component on a configuration interface, and storing the selected neural network parameter value;

[0037] Obtain structure configuration parameters in the configuration interface, and configure the network layer structure according to the structure configuration parameters;

[0038] The network layer is configured according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer;

[0039] Create a network construction class, and use the network construction class to build a neural network model based on the stored neural network parameter values, the configured network layer structure, and the creation logic of the network layer.

[0040] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0041] Obtaining a selection operation for a neural network parameter value to be selected in a neural network parameter option component on a configuration interface, and storing the selected neural network parameter value;

[0042] Obtain structure configuration parameters in the configuration interface, and configure the network layer structure according to the structure configuration parameters;

[0043] The network layer is configured according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer;

[0044] Create a network construction class, and use the network construction class to build a neural network model based on the stored neural network parameter values, the configured network layer structure, and the creation logic of the network layer.

[0045] The above-mentioned neural network model construction method, device, computer equipment, storage medium and computer program product provide multiple neural network parameter values ​​to be selected through the neural network parameter option component of the configuration interface, obtain the selection operation of the neural network parameter values ​​to be selected in the neural network parameter option component, and store the selected neural network parameter values. It is also possible to automatically configure the network layer structure according to the structural configuration parameters after obtaining the structural configuration parameters in the configuration interface. After that, the network layer is configured according to the network layer configuration data and the stored neural network parameter values, the creation logic of the network layer is obtained, and a network construction class is created. The neural network model is constructed by the network construction class according to the stored neural network parameter values, the configured network layer structure and the creation logic of the network layer. Since the neural network parameter option component provides the selection of neural network parameter values ​​and realizes the dynamic construction of the neural network model, the device model engineer can flexibly adjust the neural network parameter values ​​without manually modifying the underlying code, which effectively improves the construction efficiency of the neural network model and ensures the scalability and flexibility of the neural network model. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0047] FIG1 is an application environment diagram of a method for constructing a neural network model in one embodiment;

[0048] FIG2 is a schematic diagram of a process of constructing a neural network model in one embodiment;

[0049] FIG3 is a flow chart of configuring the network layer according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer in one embodiment;

[0050] FIG4 is a structural block diagram of a neural network model building device in one embodiment;

[0051] FIG. 5 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] The neural network model construction method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 obtains the neural network construction task issued by the server 104, and the terminal 102 obtains the selection operation of the neural network parameter value to be selected in the neural network parameter option component in the configuration interface according to the neural network construction task, and stores the selected neural network parameter value; obtains the structure configuration parameter in the configuration interface, and configures the network layer structure according to the structure configuration parameter; configures the network layer in the configured network layer structure according to the network layer configuration data and the stored neural network parameter value, and obtains the creation logic of the network layer; creates a network construction class, and constructs the neural network layer by layer through the network construction class according to the stored neural network parameter value, the configured network layer structure and the creation logic of the network layer. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones and tablets. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0054] In an exemplary embodiment, as shown in FIG2 , a method for constructing a neural network model is provided, which is described by taking the method applied to the terminal in FIG1 as an example, and includes the following steps 202 to 208. Among them:

[0055] Step 202, obtaining a selection operation for a neural network parameter value to be selected in a neural network parameter option component in a configuration interface, and storing the selected neural network parameter value.

[0056] The configuration interface refers to an operation interface for configuring a neural network. For example, the configuration interface may be a GUI (Graphics User Interface), which refers to a computer operation user interface displayed in a graphical manner. The neural network parameter option component refers to a component for selecting a neural network parameter value corresponding to a neural network parameter. For example, the neural network parameter option component may be a tab.

[0057] Optionally, a neural network parameter option component is created in the configuration interface, and the neural network parameter option component is used to display multiple candidate neural network parameter values ​​corresponding to the neural network parameters. During the construction of the neural network, the terminal obtains a selection operation for multiple candidate neural network parameter values ​​in the neural network parameter option component in the configuration interface, and determines the selected neural network parameter value according to the selection operation. The selected neural network parameter value is stored. Furthermore, the neural network parameters may include neural network structure parameters and neural network training parameters.

[0058] Step 204, obtaining structure configuration parameters in the configuration interface, and performing network layer structure configuration according to the structure configuration parameters.

[0059] Among them, the structural configuration parameters refer to the parameters used to configure the single-layer network structure, which are parameters related to device modeling.

[0060] Optionally, the structural configuration parameters of each network layer are obtained in the configuration interface, and the structure of each network layer is configured according to the structural configuration parameters of each network layer. For example, the structural configuration parameters may include different input parameters. After the structure of each network layer is configured, each network layer may implement corresponding behaviors or functions according to its own characteristics.

[0061] Step 206, configure the network layer according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer.

[0062] The network layer configuration parameters refer to configuration parameters used to dynamically create network layer logic, and are parameters related to device modeling.

[0063] Optionally, after the structure of each network layer is configured, the network layer is configured. During the network layer configuration process, the network layer configuration data input by the user is obtained, and the network layer is instantiated and configured according to the network layer configuration data through the factory pattern to obtain the configured network layer instance. Among them, the factory pattern is a creational design pattern, which is mainly used to create objects. The factory pattern provides an interface for creating objects so that the terminal does not directly call a specific class when creating an object, but points to the newly created object through a common interface. Instantiation refers to creating a specific type of network layer object in the code and adding it to the neural network. After the network layer is instantiated, it can be used to build a neural network.

[0064] The factory pattern is used to dynamically bind the stored neural network parameter values ​​to the corresponding configured network layer instances to obtain the creation logic of the network layer. The factory pattern can encapsulate the logic of creating and configuring the network layer, so that all network layers are created through a unified interface, thereby improving the flexibility and maintainability of the code.

[0065] Step 208, create a network construction class, and use the network construction class to construct a neural network model based on the stored neural network parameter values, the configured network layer structure, and the creation logic of the network layer.

[0066] After the creation logic of the network layer is completed, the dynamic network structure is constructed, that is, the neural network is constructed. Optionally, a network construction class is created, which is responsible for receiving the network design information input from the configuration interface or configuration file. The network design information refers to the stored neural network parameter values, the configured network layer structure, and the creation logic of the network layer.

[0067] The network construction class is based on the stored neural network parameter values, the configured network layer structure and the creation logic of the network layer, and the network structure is built layer by layer based on the factory mode, from the input layer to the output layer, ensuring that each network layer can be correctly instantiated and connected according to the configuration information provided by the user, that is, the structure configuration parameters, and then a dynamic neural network model is obtained. For example, the dynamic neural network model can be an artificial neural network.

[0068] Furthermore, through this dynamic construction method, the dynamic neural network can be dynamically adjusted and optimized in the process of applying the dynamic neural network to the field of device modeling. Optionally, the user can flexibly adjust the neural network structure, such as changing the number, type or parameters of the network layer, effectively improving the efficiency of building complex neural networks. At this point, the neural network parameter values ​​set in the neural network parameter option component are passed to the factory mode, thereby constructing a dynamic neural network model.

[0069] In the above-mentioned neural network model construction method, a plurality of candidate neural network parameter values ​​are provided through the neural network parameter option component of the configuration interface, a selection operation of the candidate neural network parameter values ​​in the neural network parameter option component is obtained, and the selected neural network parameter values ​​are stored. It is also possible to automatically configure the network layer structure according to the structural configuration parameters after obtaining the structural configuration parameters in the configuration interface. Afterwards, the network layer is configured according to the network layer configuration data and the stored neural network parameter values, the creation logic of the network layer is obtained, and a network construction class is created. The neural network model is constructed through the network construction class according to the stored neural network parameter values, the configured network layer structure and the creation logic of the network layer. Since the neural network parameter option component provides a selection of neural network parameter values ​​and realizes the dynamic construction of the neural network model, the device model engineer can flexibly adjust the neural network parameter values ​​without manually modifying the underlying code, which effectively improves the construction efficiency of the neural network model and ensures the scalability and flexibility of the neural network model.

[0070] In an exemplary embodiment, the neural network parameter option components include multiple, each neural network parameter option component is used to display multiple candidate neural network parameter values ​​corresponding to a neural network parameter; wherein the neural network parameter option components include an activation function option component, a neuron number option component, a neural network layer number option component, a step size option component, a loss function option component and a learning rate option component.

[0071] Optionally, multiple neural network parameter option components are created in the configuration interface, and each neural network parameter option component is used to display multiple candidate neural network parameter values ​​corresponding to a neural network parameter. Neural network parameters may include neural network structure parameters and neural network training parameters. Neural network structure parameters may also be referred to as neural network attributes. Neural network structure parameters may include the number of neurons, the number of network layers, etc. Neural network training parameters may include training step size, learning rate, loss function, activation function, etc. Neural network parameter option components may include activation function option components, number of neurons option components, number of neural network layers option components, step size option components, loss function option components, and learning rate option components. The number of neurons option components include the number of neurons option components for multiple network layers.

[0072] For example, the activation function option component displays the activation functions to be selected, such as ReLU, Sigmoid, Tanh, and other common activation functions. When the user selects a different activation function, an event is triggered, and the activation function selected by the user is stored. When configuring the network layer, by accessing the stored activation function and passing it to the corresponding network layer instance, ensure that the network layer uses the correct activation function according to the user's selection.

[0073] The number of neurons option component allows the user to enter the number of neurons for each network layer independently. When the number of neurons entered by the user is obtained, the number of neurons is stored so that the number of neurons for each network layer can be obtained when the network is created.

[0074] The neural network layer number option component can be in the form of an input box, which allows the user to set the required number of network layers, and when the number of network layers is obtained, it is stored.

[0075] The step size option component can also be in the form of an input box, allowing the user to enter or adjust the training step size. For example, the default value of the training step size can be set to 100, and the input box can be ensured to have appropriate input validation to avoid entering invalid values. When the training step size is obtained, the training step size is stored.

[0076] The loss function option component can be in the form of a drop-down menu or button group, which is used to list the available loss functions, such as cross entropy loss, mean square error, etc., to ensure that each option has a clear and clear definition description. When the selected loss function is obtained, the selected loss function is stored.

[0077] The learning rate option component can be in the form of an input box or a slider, allowing the user to set the learning rate and display the current learning rate value. When the set learning rate is obtained, the selected loss function is stored.

[0078] In this embodiment, by creating multiple neural network parameter option components, the selection operation of displaying all neural network parameters is realized, so that the neural network parameter values ​​can be flexibly adjusted by selection or self-setting. Device model engineers can more easily regulate and apply neural networks, which greatly improves the convenience of neural network configuration and significantly enhances the application effect of neural networks in the field of device modeling.

[0079] In an exemplary embodiment, a selection operation for a neural network parameter value to be selected in a neural network parameter option component is obtained on a configuration interface, and the selected neural network parameter value is stored, including: obtaining the selection operation for the neural network parameter value to be selected in the neural network parameter option component through an event monitoring device corresponding to the neural network parameter option component on the configuration interface, and obtaining the selected neural network parameter value according to the selection operation; and updating the storage structure according to the selected neural network parameter value.

[0080] Optionally, each neural network parameter option component is provided with a corresponding event monitoring device. The event monitoring device is used to obtain the selection operation of the neural network parameter value to be selected in the neural network parameter option component, and the selected neural network parameter value is obtained according to the selection operation, and the storage structure is updated according to the selected neural network parameter value, so as to realize the storage of the selected neural network parameter value. Among them, the storage structure refers to a data structure for storing neural network parameter values, such as a list or a dictionary.

[0081] Exemplarily, when selecting an activation function, the selection operation of the activation function to be selected in the activation function option component is obtained through the event listening device corresponding to the activation function option component, the selected activation function is obtained according to the selection operation, and the selected activation function is stored.

[0082] Each network layer's neuron number option component is provided with an event monitoring device. When selecting the number of neurons in each network layer, the event monitoring device corresponding to the neuron number option component of each network layer is used to monitor the input changes. When the user inputs the number of neurons, the storage structure is updated.

[0083] When selecting the number of network layers, the event listening device corresponding to the neural network layer option component is used to capture the number of network layers input by the user, and the storage structure is updated according to the number of neural network layers.

[0084] When setting the training step size, the event listening device corresponding to the step size option component is used to monitor the training step size input by the user. When the training step size input by the user is monitored, the callback function is triggered to capture the training step size input by the user and update the storage structure.

[0085] When selecting a loss function, the event listening device corresponding to the loss function option component is used to monitor the selection operation of the loss function to be selected in the loss function option component, and when the selection operation is detected, the callback function is triggered to capture the selected loss function and update the storage structure.

[0086] When setting the learning rate, the event listening device corresponding to the learning rate option component is used to monitor changes in the learning rate input by the user. When changes in the learning rate input by the user are detected, the callback function is triggered to capture the learning rate input by the user and update the storage structure.

[0087] In this embodiment, the event monitoring device corresponding to the neural network parameter option component is used in the configuration interface to obtain the selection operation of the neural network parameter value to be selected in the neural network parameter option component, so that the selected neural network parameter value can be captured in real time, which is conducive to improving the efficiency of network configuration. The storage structure is updated according to the selected neural network parameter value so that the neural network parameter value can be obtained when the network is constructed.

[0088] In an exemplary embodiment, structural configuration parameters are obtained in a configuration interface, and the network layer structure is configured according to the structural configuration parameters, including: creating a custom class in the configuration interface, and configuring the common attribute data and common behavior data of the network layer through the custom class; obtaining the input parameters of each network layer in the configuration interface, determining the input parameters of each network layer as the structural configuration parameters of the network layer, and configuring the structure of each network layer according to the structural configuration parameters of each network layer.

[0089] Optionally, a custom class is created in the configuration interface, and the custom class is used to process the common attribute data and common behavior data of the network layer. The custom class contains basic functions common to all network layers. Exemplarily, the custom class includes the definition of input parameters and output parameters and the setting of activation function type. The custom class can provide a basic framework for each specific network layer, so that each specific network layer can inherit and extend.

[0090] Afterwards, the input parameters of each network layer are obtained in the configuration interface, and the input parameters are parameters related to device modeling. The input parameters of each network layer are determined as the structural configuration parameters of the network layer, and then the structure of each network layer is configured according to the structural configuration parameters of each network layer.

[0091] Furthermore, the structure of each network layer is configured according to the structural configuration parameters of each network layer, including: for the linear layer, according to the structural configuration parameters of the fully connected layer, the structure of the fully connected layer is configured as follows: according to the multiplication operation of the structural configuration parameters of the fully connected layer and the weight matrix, and combined with the bias term, to complete the forward propagation; for the convolutional layer, according to the structural configuration parameters of the convolutional layer, the structure of the convolutional layer is configured as follows: convolution operation is performed on the structural configuration parameters of the convolutional layer through the convolution kernel.

[0092] Among them, the linear layer can be a fully connected layer. The fully connected layer can complete the forward propagation by implementing the multiplication operation of the input parameters and the weight matrix, and combining the bias term. The convolution layer performs a convolution operation on the input parameters through the convolution kernel. Furthermore, for the pooling layer, the pooling layer reduces the dimension by selecting the maximum value or average value of the local area of ​​the input parameter. For example, the pooling layer can be a maximum pooling layer or an average pooling layer. Each specific network layer will inherit this base class and implement corresponding behaviors and functions according to its own characteristics.

[0093] In an exemplary embodiment, as shown in FIG3 , the network layer is configured according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer, including steps 302 to 306. Among them:

[0094] Step 302: Select a corresponding network layer object according to the type identifier of the network layer, and instantiate the network layer object to obtain a network layer instance.

[0095] Step 304: configure the network layer instance according to the operation configuration parameters of the network layer to obtain the configured network layer instance.

[0096] Step 306, dynamically bind the stored neural network parameter values ​​to the configured network layer instance to obtain the creation logic of the network layer.

[0097] The network layer configuration data includes the type identifier of the network layer and the operation configuration parameters of the network layer.

[0098] Optionally, the network layer is configured according to the network layer configuration data and the stored neural network parameter values ​​through the factory mode to obtain the creation logic of the network layer. The factory mode allows different types of network layers to be flexibly instantiated according to needs. The factory mode can also implement the logic of dynamically creating network layer objects according to different operation configuration parameters and activation functions.

[0099] In the process of configuring the network layer, the factory mode is used to select and instantiate the corresponding network layer object according to the type identifier of the network layer to obtain the network layer instance. The type identifier of the network layer can be a type identifier, such as Conv2D or Linear. The network layer object refers to different types of network layers in the neural network.

[0100] Afterwards, the network layer instance is specifically initialized and configured according to the operation configuration parameters of the network layer to obtain the configured network layer instance. The operation configuration parameters of the network layer may include input parameters, output parameters, etc. The activation function in the stored neural network parameter value is dynamically bound to the configured network layer instance to obtain the creation logic of the network layer. Furthermore, the activation function can be set through a callback function so that each network layer can customize its behavior according to user needs. For example, different activation functions, such as ReLU, Sigmoid, Tanh, etc., can be selected and dynamically bound to each network layer.

[0101] In this way, the factory pattern can encapsulate the complex logic of creating and configuring the network layer, so that different types of network layers can be created through a unified interface, thereby improving the flexibility and maintainability of the code.

[0102] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0103] Based on the same inventive concept, the embodiment of the present application also provides a neural network model construction device for implementing the neural network model construction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more neural network model construction device embodiments provided below can refer to the limitations of the neural network model construction method above, and will not be repeated here.

[0104] In an exemplary embodiment, as shown in FIG4 , a neural network model construction device is provided, comprising: a parameter selection module 402, a structure configuration module 404, a network layer configuration module 406 and a model construction module 408, wherein:

[0105] The parameter selection module 402 is used to obtain the selection operation of the neural network parameter values ​​to be selected in the neural network parameter option component in the configuration interface, and store the selected neural network parameter values.

[0106] The structure configuration module 404 is used to obtain structure configuration parameters in the configuration interface and perform network layer structure configuration according to the structure configuration parameters.

[0107] The network layer configuration module 406 is used to configure the network layer according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer.

[0108] The model construction module 408 is used to create a network construction class, and construct a neural network model through the network construction class according to the stored neural network parameter values, the configured network layer structure and the creation logic of the network layer.

[0109] In an exemplary embodiment, the neural network parameter option components include multiple, each neural network parameter option component is used to display multiple candidate neural network parameter values ​​corresponding to a neural network parameter; wherein the neural network parameter option component includes an activation function option component, a neuron number option component, a neural network layer number option component, a step size option component, a loss function option component and a learning rate option component.

[0110] In an exemplary embodiment, the parameter selection module 402 is also used to obtain the selection operation of the neural network parameter value to be selected in the neural network parameter option component through the event monitoring device corresponding to the neural network parameter option component in the configuration interface, and obtain the selected neural network parameter value according to the selection operation; and update the storage structure according to the selected neural network parameter value.

[0111] In an exemplary embodiment, the structure configuration module 404 is also used to create a custom class in the configuration interface, and configure the common attribute data and common behavior data of the network layer through the custom class; obtain the input parameters of each network layer in the configuration interface, determine the input parameters of each network layer as the structural configuration parameters of the network layer, and configure the structure of each network layer according to the structural configuration parameters of each network layer.

[0112] In an exemplary embodiment, the structure configuration module 404 is also used to configure the structure of the linear layer according to the structure configuration parameters of the linear layer as follows: completing forward propagation according to the multiplication operation of the structure configuration parameters of the linear layer and the weight matrix in combination with the bias term; and for the convolution layer, configuring the structure of the convolution layer according to the structure configuration parameters of the convolution layer as follows: performing a convolution operation on the structure configuration parameters of the convolution layer through a convolution kernel.

[0113] In an exemplary embodiment, the network layer configuration data includes a type identifier of the network layer and operation configuration parameters of the network layer; the network layer configuration module 406 is further used to select a corresponding network layer object according to the type identifier of the network layer, and instantiate the network layer object to obtain a network layer instance; configure the network layer instance according to the operation configuration parameters of the network layer to obtain a configured network layer instance; dynamically bind the stored neural network parameter values ​​to the configured network layer instance to obtain the creation logic of the network layer.

[0114] Each module in the above-mentioned neural network model construction device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0115] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for building a neural network model is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0116] Those skilled in the art will understand that the structure shown in FIG. 5 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0117] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0118] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0119] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0120] 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, stored data, displayed data, 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 relevant data must comply with relevant regulations.

[0121] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0122] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 specification.

[0123] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for constructing a neural network model, characterized in that: The method comprises: Obtaining a selection operation for a neural network parameter value to be selected in a neural network parameter option component on a configuration interface, and storing the selected neural network parameter value; Acquire structure configuration parameters in the configuration interface, and perform network layer structure configuration according to the structure configuration parameters; The network layer is configured according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer; A network construction class is created, and a neural network model is constructed by the network construction class according to the stored neural network parameter values, the configured network layer structure and the creation logic of the network layer.

2. The method according to claim 1, characterized in that The neural network parameter option components include multiple ones, each of which is used to display multiple candidate neural network parameter values ​​corresponding to one neural network parameter; Among them, the neural network parameter option component includes an activation function option component, a neuron number option component, a neural network layer number option component, a step size option component, a loss function option component and a learning rate option component.

3. The method according to claim 1, characterized in that The step of obtaining a selection operation of a neural network parameter value to be selected in a neural network parameter option component on a configuration interface and storing the selected neural network parameter value comprises: In the configuration interface, through the event monitoring device corresponding to the neural network parameter option component, the selection operation of the neural network parameter value to be selected in the neural network parameter option component is obtained, and the selected neural network parameter value is obtained according to the selection operation; The storage structure is updated according to the selected neural network parameter values.

4. The method according to claim 1, characterized in that: The acquiring structure configuration parameters in the configuration interface and performing network layer structure configuration according to the structure configuration parameters includes: Creating a custom class in the configuration interface, and configuring the common attribute data and common behavior data of the network layer through the custom class; The input parameters of each network layer are obtained in the configuration interface, the input parameters of each network layer are determined as the structural configuration parameters of the network layer, and the structure of each network layer is configured according to the structural configuration parameters of each network layer.

5. The method according to claim 4, characterized in that The configuring the structure of each network layer according to the structural configuration parameters of each network layer includes: For the linear layer, the structure of the linear layer is configured according to the structural configuration parameters of the linear layer: the forward propagation is completed according to the multiplication operation of the structural configuration parameters of the linear layer and the weight matrix, and combined with the bias term; For the convolution layer, the structure of the convolution layer is configured according to the structural configuration parameters of the convolution layer as follows: a convolution operation is performed on the structural configuration parameters of the convolution layer through a convolution kernel.

6. The method according to claim 1, characterized in that The network layer configuration data includes a type identifier of the network layer and operation configuration parameters of the network layer; The network layer is configured according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer, including: Selecting a corresponding network layer object according to the type identifier of the network layer, and instantiating the network layer object to obtain a network layer instance; Configuring the network layer instance according to the operation configuration parameters of the network layer to obtain a configured network layer instance; The stored neural network parameter values ​​are dynamically bound to the configured network layer instance to obtain the creation logic of the network layer.

7. A neural network model construction device, characterized in that: The device comprises: A parameter selection module is used to obtain the selection operation of the neural network parameter value to be selected in the neural network parameter option component in the configuration interface, and store the selected neural network parameter value; A structure configuration module, used to obtain structure configuration parameters in the configuration interface, and perform network layer structure configuration according to the structure configuration parameters; The network layer configuration module is used to configure the network layer according to the network layer configuration data and the stored neural network parameter values ​​to obtain the creation logic of the network layer; The model construction module is used to create a network construction class, through which a neural network model is constructed according to the stored neural network parameter values, the configured network layer structure and the creation logic of the network layer.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

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

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

Citation Information

Cited By

  • Model-based visual code-free neural network construction method

    CN120046703A