Photonic crystal design method, device, computer equipment and storage medium

By combining deep neural networks and reinforcement learning models, the problem of low efficiency in traditional photonic crystal design is solved, and efficient and accurate photonic crystal structure generation is achieved.

CN116702592BActive Publication Date: 2026-06-05SHENZHEN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN UNIV
Filing Date
2023-05-18
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In the traditional photonic crystal structure design process, direct reverse design results in an output structure that is an average value of multiple parameters, which cannot meet the design requirements and is time-consuming and inefficient.

Method used

By combining deep neural networks and reinforcement learning models, an agent is trained by generating datasets to adjust the physical parameters of photonic crystals in order to output multiple predicted structures that meet the design requirements.

Benefits of technology

This improves the efficiency and accuracy of generating photonic crystals that meet design requirements, reduces design time, and enhances the storage and search efficiency of photonic crystal structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116702592B_ABST
    Figure CN116702592B_ABST
Patent Text Reader

Abstract

The embodiment of the application is suitable for the technical field of photonic crystal design, and provides a photonic crystal design method, device, computer equipment and storage medium, the photonic crystal design method comprises: determining the structure of a photonic crystal to be generated; generating a data set according to the structure; training a deep neural network model using the data set; constructing a reinforcement learning model, the reinforcement learning model comprising an agent; using the agent and the deep neural network model, output a plurality of predicted structures, any of the predicted structures comprising a corresponding band gap structure. The photonic crystal design method can improve the efficiency of generating photonic crystals that meet the design requirements, and can search for the photonic crystal structure to be taken in the storage space that stores a large number of search effective photonic crystal structures, ensuring the efficiency and accuracy of photonic crystal design.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of photonic crystal design technology, and in particular relates to a photonic crystal design method, apparatus, computer equipment and storage medium. Background Technology

[0002] With the development of photonic crystals and photonic technology in recent years, the bottlenecks in electronic technology of semiconductor crystals, such as high heat generation, high energy consumption, narrow bandwidth and quantum tunneling, have been overcome. When designing photonic crystal structures, it is often necessary to spend a lot of time on multiple numerical simulations. The whole process relies on iterative methods.

[0003] In the traditional design process of photonic crystal structures, the direct reverse design approach is usually adopted. However, since one-dimensional photonic crystals with different structures may exhibit the same physical properties, when the direct reverse design approach is adopted, the output one-dimensional photonic crystal structure will be the average value of many parameters, which will not meet the design requirements. Summary of the Invention

[0004] In view of this, embodiments of this application provide a photonic crystal design method, apparatus, computer device, and storage medium to improve the efficiency of obtaining photonic crystals with desired bandgap structures.

[0005] The first aspect of this application provides a photonic crystal design method, including:

[0006] Determine the structure of the photonic crystal to be generated;

[0007] Based on the structure, a dataset is generated, wherein any data in the dataset conforms to the structural requirements of the structure.

[0008] The dataset was used to train a deep neural network model;

[0009] Construct a reinforcement learning model, wherein the reinforcement learning model includes an agent;

[0010] Using the intelligent agent and the deep neural network model, multiple prediction structures are output, and each prediction structure contains a corresponding bandgap structure.

[0011] A second aspect of this application provides a photonic crystal design apparatus, comprising:

[0012] The determination module is used to determine the structure of the photonic crystal to be generated;

[0013] A dataset generation module is used to generate a dataset according to the structure, wherein any data in the dataset conforms to the structural requirements of the structure.

[0014] The training module is used to train a deep neural network model using the dataset.

[0015] A model building module is used to build a reinforcement learning model, wherein the reinforcement learning model includes an agent;

[0016] The output module is used to output multiple prediction structures using the agent and the deep neural network model, wherein each prediction structure contains a corresponding bandgap structure.

[0017] A third aspect of this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the photonic crystal design method as described in the first aspect above.

[0018] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the photonic crystal design method as described in the first aspect above.

[0019] Compared with the prior art, the embodiments of this application have the following advantages:

[0020] In this embodiment, a combination of deep neural networks and reinforcement learning models is used to obtain multiple predicted structures of photonic crystals that meet design requirements based on the structure of the photonic crystal. This can improve the efficiency of generating photonic crystals that meet design requirements and allows for the search of the required photonic crystal structure in a storage space that stores a large number of searchable photonic crystal structures, thus ensuring the efficiency and accuracy of photonic crystal design. Attached Figure Description

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

[0022] Figure 1 This is a schematic flowchart of a photonic crystal design method provided in an embodiment of this application;

[0023] Figure 2 This is a schematic diagram of a process for outputting multiple prediction structures provided in an embodiment of this application;

[0024] Figure 3 This is a schematic diagram of a process for calculating multiple bandgap structures provided in an embodiment of this application;

[0025] Figure 4 This is a schematic flowchart illustrating a process for calculating the reward value of multiple bandgap structures, provided in an embodiment of this application.

[0026] Figure 5 This is a schematic diagram of a process for outputting multiple prediction structures provided in an embodiment of this application;

[0027] Figure 6 This is a schematic diagram of a process for training a neural network model provided in an embodiment of this application;

[0028] Figure 7 This is a schematic diagram of the structure of a reinforcement learning model provided in an embodiment of this application;

[0029] Figure 8 This is a schematic diagram of a process for training a deep learning model provided in an embodiment of this application;

[0030] Figure 9 This is a schematic diagram of a photonic crystal design device provided in an embodiment of this application;

[0031] Figure 10 This is a schematic diagram of a computer device provided in an embodiment of this application. Detailed Implementation

[0032] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0033] It should be noted that the terminology used in the implementation section of the embodiments of this application is only used to explain the specific embodiments of this application and is not intended to limit this application. In the description of the embodiments of this application, unless otherwise stated, " / " means "or", for example, A / B can mean A or B; "and / or" in this document is merely a description of the association relationship of related obstacles, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. In addition, in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, "at least one" or "one or more" means one, two or more.

[0034] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0035] References to "one embodiment" or "some embodiments" as used in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0036] The technical solution of this application will be described below through specific embodiments.

[0037] like Figure 1 The diagram shown is a flowchart illustrating a photonic crystal design method provided in an embodiment of this application.

[0038] The method may include the following steps S101-S105:

[0039] S101. Determine the structure of the photonic crystal to be generated.

[0040] In this embodiment of the application, the photonic crystal may be composed of multiple layers of crystals made of different materials. Determining the structure of the photonic crystal to be generated may involve determining the number of crystal layers that make up the photonic crystal to be generated.

[0041] In practical implementation, the structure of the photonic crystal to be generated can be determined to be an abcd structure. This abcd structure means that the photonic crystal is composed of four layers of materials with different thicknesses. It should be noted that the specific number of layers can be determined according to the requirements of the designer.

[0042] S102. Generate a dataset based on the structure described above.

[0043] In this embodiment of the application, a dataset is generated based on the structure of the photonic crystal. Any data in the dataset conforms to the structural requirements of the photonic crystal structure. Specifically, the dataset may include the physical parameters of each crystal layer that makes up the photonic crystal to be generated and the bandgap structure corresponding to each photonic crystal.

[0044] As a specific example of this embodiment, the physical parameters may include the dielectric constant, magnetic permeability, and thickness of each layer of the photonic crystal.

[0045] In a concrete implementation, this dataset can be represented as follows:

[0046] D = (S3×4 (bandgap)

[0047] S 3×4 ={(ε a ,ε b ,ε c ,ε d ),(μ a ,μ b ,μ c ,μ d ),(d a ,b,d c ,d)}

[0048] Where D is the dataset, S 3×4 This is a matrix composed of the physical parameters of each crystal layer in each photonic crystal, specifically, (ε a ,ε b ,ε c ,ε d ) represents the dielectric constant of each of the four crystal layers in a photonic crystal, (μ) a ,μ b ,μ c ,μ d ) represents the permeability of each of the four crystal layers in the photonic crystal, (d a ,d b ,d c ,d d ) represents the thickness of each of the four crystal layers in the photonic crystal, and bandgap represents the bandgap structure of any photonic crystal structure.

[0049] In a practical implementation, the dataset can be generated using the transfer matrix method. It should be noted that the transfer matrix method is a means and method of using matrices to describe the relationship between the output and input of a linear system with multiple inputs and multiple outputs.

[0050] In the embodiments of this application, the value ranges of various types of physical parameters can be predetermined. For example, the range of dielectric constant can be determined to be 1-20, the range of magnetic permeability to be 0.5-1.5, and the range of thickness to be 0-1. In addition, other parameters need to be set, such as the total amount of data to be generated in the dataset, frequency, wavenumber, and other parameters.

[0051] In the embodiments of this application, the transfer matrix method can be used to generate multiple photonic crystal structures and corresponding bandgap structures. For example, 100,000 sets of photonic crystal structures and corresponding bandgap structures can be generated, and each set of photonic crystal structures includes the physical parameters corresponding to 4 crystal layers.

[0052] S103. Train a deep neural network model using the dataset.

[0053] In this embodiment of the application, after the dataset is generated, the pre-generated deep neural network model is trained using the dataset.

[0054] In this embodiment of the application, the trained deep neural network model can calculate the bandgap structure corresponding to the input photonic crystal structure.

[0055] In practice, the PyTorch framework can be used to build this deep neural network model. It should be noted that the PyTorch framework is an open-source Python machine learning library used to build deep learning models. When building this deep neural network model, the network structure, optimizer, loss function, training cycle, learning rate, etc. need to be specified.

[0056] S104. Construct a reinforcement learning model.

[0057] In this embodiment of the application, when constructing a reinforcement learning model, the agent can be initialized and the photonic crystal learning environment can be set first.

[0058] In this embodiment of the application, the photonic crystal learning environment may include: an action space, a state space, a parameter decision module, and a reward function.

[0059] Specifically, the action space can include specifying the actions to be performed by the reinforcement learning model. For example, in the action space, action 0 can be specified as increasing a physical parameter by 10%, action 1 as decreasing a physical parameter by 10%, action 2 as increasing a physical parameter by 0.5%, action 3 as decreasing a physical parameter by 0.5%, and action 4 as not modifying any physical parameter.

[0060] Specifically, the state space can be determined based on the photonic crystal structure to be generated. For example, the state space may include:

[0061] State = [w1, w2, w3...]

[0062] S 3×4 ′={(ε a ,ε b ,ε c ,ε d ),(μ a ,μ b ,μ c ,μ d ),(d a ,d b ,d c ,d d )

[0063] Where State is the set of state values, and w in this set of state values ​​represents the bandgap structure corresponding to each photonic crystal structure, and S 3×4 ′ represents the set of physical parameters, and S 3×4 The value of each preset physical parameter can be included in the value of the S. 3×4 The values ​​corresponding to each physical parameter in ' are all set to 0.5. It should be noted that the physical parameters here are normalized parameters.

[0064] Specifically, the parameter decision module can include acquiring the execution action set in the action space and deciding on the action to be executed. For example, acquiring action 2, which modifies a certain physical parameter by increasing it by 0.5%. This parameter decision module can also be used to set the parameter type for each adjustment of the physical parameter.

[0065] Specifically, the reward function may include a function that calculates the reward value based on the bandgap structure.

[0066] In one possible implementation of this application embodiment, a reinforcement learning algorithm can also be selected. In specific implementation, PPO (Proximal Policy Optimization) or DQN (Deep Q-network) algorithms can be used as reinforcement learning algorithms. The algorithm is used to train the agent to perform purposeful actions in a certain environment. Through continuous trial and learning, it helps the agent find the best way to perform effective actions, thereby obtaining the greatest reward.

[0067] In this embodiment of the application, the intelligent agent is initialized and generated so that the intelligent agent can select to perform an action according to the current environmental state and adjust the physical parameters according to the action performed.

[0068] S105. Employs an intelligent agent and a deep neural network model to output multiple prediction structures.

[0069] like Figure 2 The diagram shown is a flowchart illustrating the output of multiple prediction structures according to an embodiment of this application, which may specifically include steps S201-S205:

[0070] S201. Based on the first physical parameters preset by the photonic crystal, the first bandgap structure is calculated by calling the deep neural network model.

[0071] In this embodiment of the application, based on the determined structure of the photonic crystal, the first physical parameter is preset. Specifically, according to the foregoing embodiment, when the structure of the photonic crystal is determined to be composed of 4 crystal layers, the preset first physical parameter may include 12 data, which include the dielectric constant, permeability and thickness of each crystal layer.

[0072] In this embodiment of the application, the deep neural network model is invoked, and the first bandgap structure corresponding to the first physical parameter is calculated based on the first physical parameter.

[0073] S202. Based on the first bandgap structure, the agent is invoked to adjust the first physical parameters to obtain the second physical parameters.

[0074] In this embodiment of the application, the intelligent agent is invoked to adjust the first physical parameter to obtain the second physical parameter.

[0075] In a practical implementation, the agent can adjust only one physical parameter of the first physical parameter each time it is invoked.

[0076] In one possible implementation of this application embodiment, based on the first bandgap structure, the parameter type to be adjusted in the first physical parameter and the adjustment value corresponding to the parameter type are determined. Based on the adjustment value and the parameter type, the first physical parameter is adjusted to obtain the second physical parameter.

[0077] S203. Based on the second physical parameters, the deep neural network model is invoked to calculate multiple bandgap structures.

[0078] In this embodiment of the application, the deep neural network model is invoked, and multiple bandgap structures are calculated based on the second physical parameter.

[0079] like Figure 3 The diagram shown is a flowchart illustrating the calculation of multiple bandgap structures according to an embodiment of this application, which may specifically include steps S301-S303:

[0080] S301. Based on the second physical parameters, a new bandgap structure is calculated by calling the deep neural network model.

[0081] In this embodiment of the application, a new bandgap structure is calculated by calling the deep neural network model based on the second physical parameter.

[0082] S302. Based on the new bandgap structure obtained each time, the agent is invoked to adjust the physical parameters corresponding to the new bandgap structure to obtain new physical parameters.

[0083] In this embodiment of the application, based on the new bandgap structure obtained each time, the agent is invoked to adjust the physical parameters corresponding to the new bandgap structure to obtain new physical parameters.

[0084] S303. Based on the new physical parameters, the deep neural network model is invoked to calculate multiple bandgap structures.

[0085] In this embodiment of the application, the total number of adjustments to the physical parameter is preset. After obtaining the new physical parameter, the neural network model is called to calculate the bandgap structure corresponding to the physical parameter.

[0086] Specifically, after each adjustment of the physical parameters, the bandgap structure and reward value of the physical parameters are calculated based on the adjusted physical parameters. The predicted structure is then output based on the reward value until the total number of adjustments to the physical parameters reaches a preset threshold.

[0087] S204. Calculate the reward value of each of the multiple bandgap structures.

[0088] In this embodiment of the application, after each modification of the physical parameters, a deep neural network model is called to calculate the bandgap structure corresponding to the modified physical parameters, and a loss value is obtained based on the bandgap structure. A reward value is calculated based on the loss value. The reward value is used to evaluate the degree of similarity between the expected bandgap structure and the bandgap structure obtained after multiple modifications of the physical parameters.

[0089] like Figure 4 The diagram shown is a flowchart illustrating a method for calculating the reward value of multiple bandgap structures according to an embodiment of this application, which may specifically include steps S401-S406:

[0090] S401. Determine the desired bandgap structure.

[0091] In this embodiment of the application, the desired bandgap structure includes a target bandgap width, a target upper endpoint value, and a target lower endpoint value.

[0092] Before calculating the reward value of the multiple bandgap structures, the desired bandgap structure is predetermined. The reward value is used to evaluate the degree of similarity between the desired bandgap structure and the bandgap structure obtained after multiple modifications to the physical parameters.

[0093] S402. Calculate the difference between the upper endpoint value and the lower endpoint value of each bandgap structure to obtain the bandgap width of each bandgap structure.

[0094] In this embodiment, the bandgap structure corresponding to each modified physical parameter is processed to obtain the bandgap width corresponding to each bandgap structure. The specific formula is as follows:

[0095] h = w a -w b

[0096] Where h is the bandgap width corresponding to each bandgap structure, w a w is the value at the upper endpoint of the bandgap structure. b The lower endpoint value of the bandgap structure.

[0097] In one possible implementation of this application embodiment, the bandgap width bonus value can be calculated based on the bandgap width, and the specific calculation formula is as follows:

[0098]

[0099] Where r1 is the bonus value for that bandgap width. This is the first hyperparameter, which can be set as needed.

[0100] S403. Calculate the bandgap difference between the bandgap width of each bandgap structure and the target bandgap width.

[0101] In this embodiment, the difference between the upper endpoint value and the lower endpoint value of the target is calculated to obtain the target bandgap width, and the specific formula is as follows:

[0102] h′=w at -w bt

[0103] Where h' is the target bandgap width, w at w is the upper endpoint value of the target. bt The lower endpoint value of the target.

[0104] S404. Calculate the difference between the upper endpoint value of each bandgap structure and the target upper endpoint value. In this embodiment, the formula for calculating the difference is as follows:

[0105] w′ a =(w a -w at )

[0106] Among them, w′ a w is the difference between the upper endpoints. a For each bandgap structure's upper endpoint value, w at The upper endpoint value of the target.

[0107] S405. Calculate the difference between the lower endpoint value of each bandgap structure and the lower endpoint value of the target lower endpoint. In this embodiment, the formula for calculating the difference between the lower endpoints is as follows:

[0108] w′ b =(w b -w bt )

[0109] Among them, w′ b w is the difference between the lower endpoints. b For each lower endpoint value of a bandgap structure, w bt The lower endpoint value of the target.

[0110] S406. Calculate the reward value for each bandgap structure based on the bandgap difference, the upper endpoint difference, and the lower endpoint difference.

[0111] In one possible implementation of this application embodiment, the endpoint difference reward value can be calculated based on the upper endpoint difference and the lower endpoint difference, and the specific formula is as follows:

[0112] r2=-log{γ·[(w a -wat) 2 +(w b -wbt) 2 ]}

[0113] Where γ is the second hyperparameter, which can be set as needed, and r2 is the endpoint difference reward value.

[0114] Based on the bandgap width reward value and the endpoint difference reward value, the final reward function is set as follows:

[0115]

[0116] Where α is the critical value for bandgap width reward in the reward function, and β is the critical value for endpoint difference reward. The target bandgap width can be used as the critical value for bandgap width reward. It should be noted that the critical value for endpoint difference reward can be set as needed.

[0117] In one possible implementation of this application, an out-of-bounds penalty may be added.

[0118] The reward function is as follows:

[0119]

[0120]

[0121] In the initial stage of the reinforcement learning algorithm, the exploration range is set in advance, all physical parameters are normalized, and the exploration range is set within the interval [0-1]. If out-of-bounds behavior occurs during the exploration process, an appropriate penalty can be given. Specifically, a penalty factor can be set, and the judgment condition is as above. param represents the value of the physical parameter, and action represents the action value to be taken. The out-of-bounds action is limited to the boundary by the clip function. It should be noted that the clip function is used to limit the upper and lower bounds of the array.

[0122] S205. Based on the reward value, output multiple prediction structures.

[0123] like Figure 5The diagram shown is a flowchart illustrating the output of multiple prediction structures according to an embodiment of this application, which may specifically include steps S501-S504:

[0124] S501. When the reward value of a bandgap structure is calculated for the first time, the reward value of the bandgap structure and the physical parameters corresponding to the bandgap structure are stored in a preset first reward value queue.

[0125] In this embodiment of the application, a first reward value queue is set in advance. The initial state of the first reward value queue is an empty queue. When a reward value corresponding to the bandgap structure is calculated for the first time, the reward value and the physical parameters corresponding to the bandgap structure are stored in the first reward value queue.

[0126] S502. When the reward value of any of the bandgap structures is calculated, determine whether to store the reward value of the bandgap structure and the physical parameters corresponding to the bandgap structure into the first reward value queue based on the relationship between the reward value of the bandgap structure and each reward value in the first reward value queue.

[0127] In this embodiment of the application, when the reward value corresponding to any bandgap structure is calculated for the first time, it is determined whether to store the reward value corresponding to any bandgap structure into the first reward value queue based on the size relationship between the reward value corresponding to any bandgap structure and each reward value in the first reward value queue.

[0128] In one possible implementation of this application embodiment, the calculated reward value of the bandgap structure is compared with each reward value in the first reward value queue.

[0129] When the calculated reward value of the bandgap structure is greater than the maximum value in the first reward value queue, the calculated reward value of the bandgap structure and the corresponding physical parameters of the bandgap structure are stored in the first reward value queue.

[0130] When the calculated reward value of the bandgap structure is less than or equal to the maximum value in the first reward value queue, the calculated reward value of the bandgap structure is discarded.

[0131] S503. When the number of times the physical parameters corresponding to the bandgap structure are adjusted reaches a preset threshold, if the maximum value of the reward value in the first reward value queue is greater than the minimum value of the reward value in the second reward value queue, then the maximum value of the reward value in the first reward value queue is stored in the second reward value queue.

[0132] In this embodiment of the application, the total number of times the physical parameters are adjusted in each round can be preset. Specifically, the total number of times the physical parameters are adjusted in each round is preset as a threshold.

[0133] In a practical implementation, the number of times the physical parameters are adjusted in each round can be set to 12, and the total number of rounds can be set to 50. The number of times the physical parameters are adjusted in each round can be set according to the structure of the photonic crystal, and the total number of rounds can be set as needed.

[0134] Specifically, after determining the structure of the photonic crystal to be generated, the number of crystal layers that make up the photonic crystal to be generated is determined. When the number of crystal layers is 4 and there are 3 types of physical parameters, each crystal layer has 3 corresponding types of physical parameters, that is, there are a total of 12 physical parameters. In each round of adjustment of physical parameters, changing these 12 physical parameters constitutes one round of adjustment.

[0135] When the number of times the physical parameters corresponding to the bandgap structure are adjusted reaches the preset threshold, it means that all 12 physical parameters have been adjusted in this round. At this time, the maximum value of the reward value in the first reward value queue and the minimum value of the reward value in the second reward value queue are compared. When the maximum value of the reward value in the first reward value queue is greater than the minimum value of the reward value in the second reward value queue, the maximum value of the reward value in the first reward value queue is stored in the second reward value queue.

[0136] S504. Output multiple prediction structures based on the second reward value queue.

[0137] In this embodiment of the application, when the total number of rounds in which the physical parameters are adjusted reaches the round threshold, multiple prediction structures in the second reward value queue are output.

[0138] In a specific implementation, according to the aforementioned embodiment, when the total number of rounds for adjusting the physical parameters is 50, it means that the total number of rounds for adjusting the physical parameters has reached the round threshold, the training of the reinforcement learning model has been completed, and an agent that can be used to intelligently adjust the physical parameters has been obtained. At this time, the prediction structure stored in the second reward value queue is output.

[0139] In one possible implementation of this application, the physical parameters of the photonic crystal and its corresponding bandgap structure are input as state to the agent, enabling the agent to make decisions, modify the physical parameters corresponding to the structure of the photonic crystal, and obtain bandgap information, reward value, and new state information by calling a deep neural network model to predict the current photonic crystal structure. The new state information may include the relevant state, action reward, and next state. The new state information is saved in a buffer, and the data in the buffer is sampled using the PPO algorithm. The agent is trained by continuously updating a preset first neural network and a second neural network. The first neural network may be an action network (actor), and the second neural network may be a policy network (critic).

[0140] The above implementation method is called the on-policy policy evaluation value calculation formula, which is as follows:

[0141] G = R + ′

[0142] Where R is the reward function, ′ is the function value corresponding to the pre-set target agent, and G is the agent's evaluation value of the current environment. Data is sampled from the buffer, and the agent setting parameters of the pre-set agent G are adjusted so that the sum of the pre-set agent's evaluation value ′ for the next state environment and the obtained reward function R is as close as possible to the value of G.

[0143] In one possible implementation of this application embodiment, the output prediction structure may include the structure of multiple photonic crystals, the bandgap structure corresponding to each photonic crystal, and the physical parameters corresponding to each photonic crystal.

[0144] In one possible implementation of this application embodiment, before outputting the prediction structure, the data contained in the prediction structure can be optimized as needed. In a specific implementation, a structure filter can be set up, and noise can be added to the data contained in the prediction structure using the structure filter. The neural network is then called to filter the data and select the better data to output.

[0145] like Figure 6 The diagram shown is a flowchart illustrating the training of a deep neural network model according to an embodiment of this application, which may specifically include steps S601-S611:

[0146] S601. Define free variables and data.

[0147] In this application embodiment, before designing the photonic crystal, a deep neural network model needs to be trained. The neural network model provided in this application embodiment...

[0148] S602, Define physical parameters.

[0149] S603. Generate the dataset using the transfer matrix method.

[0150] S604, Export dataset.

[0151] S605. Preprocess the data in the dataset.

[0152] Steps S601-S605 in this embodiment are similar to S101-S103 in the previous embodiment and can be referred to each other. They will not be repeated here.

[0153] S606. Initialize the network structure.

[0154] In this embodiment of the application, the network structure is initialized. The network structure can be a deep neural network (DNN). The deep neural network is a fully connected neural network. The output features of the previous layer are used as the input of the next layer for feature learning. After layer-by-layer feature mapping, the features of the existing spatial samples are mapped to another feature space, so as to learn a better feature representation of the existing input.

[0155] S607. Set the loss function.

[0156] In this embodiment, the method for calculating the loss function can be defined as MSE. It should be noted that in machine learning algorithms, the objective function is the core guiding principle for the entire model optimization learning process. When the objective function needs to be minimized, it is also called the loss function or cost function. For supervised learning tasks, the goal is usually to make the predicted value as close to the label as possible, i.e., to minimize the objective function. Therefore, in neural networks, it is generally referred to as the loss function.

[0157] S608, Configure Optimizer.

[0158] In the embodiments of this application, the Adam optimization algorithm can be used to set the optimizer. It should be noted that the Adam optimization algorithm is a first-order optimization algorithm that can replace the traditional stochastic gradient descent process. It can iteratively update the neural network weights based on the training data.

[0159] S609. Set training parameters.

[0160] In this embodiment of the application, the training parameters may include the total number of training rounds, the number of hidden layers in the deep neural network model, the size of the hidden layers, the number of training sets, and other parameters.

[0161] S610, training a deep neural network model.

[0162] S611, Save the deep neural network model.

[0163] In this embodiment, the deep neural network is trained based on the functions and parameters determined in the above embodiments, and the trained deep neural network is called during the design of photonic crystals.

[0164] like Figure 7 The diagram shown is a structural schematic of a reinforcement learning model provided in an embodiment of this application, which may specifically include an agent 70, a reinforcement learning environment 71, and a deep neural network model 72.

[0165] In this embodiment, the reinforcement learning environment 71 may include an action space 710, a state space 711, a parameter decision module 712, and a reward function 713. After modifying the physical parameters, the reinforcement learning environment 71 obtains new physical parameters and saves these parameters to a buffer. This buffer serves as a cache for storing data. In this embodiment, the buffer caches multiple data sets. Each data set may include state information, an action to be performed based on that state, a reward value, and updated state information. The physical parameters are then provided to the agent 70. After receiving the data set from the buffer, the agent 70 performs an action based on the state information. The state information may include the physical parameters of the photonic crystal structure and the corresponding bandgap structure. After performing the action, the agent 70 obtains the new physical parameters, calls the deep neural network model 72 to calculate the bandgap structure corresponding to the new physical parameters, calculates the corresponding reward value, and saves the updated state information to the data set.

[0166] In this embodiment, the deep neural network model 72 is used to calculate the corresponding bandgap structure based on the physical parameters of the photonic crystal. This deep neural network model 72 needs to be trained before being invoked by the reinforcement learning model, such as... Figure 8 The diagram shown is a flowchart illustrating the training of a deep neural network model according to an embodiment of this application, which may specifically include steps S801-S804:

[0167] S801. Generate the dataset using the transfer matrix method.

[0168] In this embodiment of the application, the method for training a deep neural network model defines a mapping relationship, with the structure of a photonic crystal composed of four different materials as input and the bandgap structure as output. The physical parameters corresponding to the structure of the photonic crystal composed of the four different materials are 12. Therefore, the trained deep neural network model can output the corresponding bandgap structure according to the structure of the photonic crystal.

[0169] S802, Data Preprocessing.

[0170] S803, Input the data into the deep neural network.

[0171] In this embodiment of the application, the deep neural network (DNN) is a fully connected neural network, and the output features of the previous layer are used as the input of the next layer for feature learning. After layer-by-layer feature mapping, the features of the existing spatial samples are mapped to another feature space, thereby learning to have a better feature representation of the existing input.

[0172] S804. The bandgap structure is calculated.

[0173] Steps S801-S804 in this embodiment are similar to S101-S103 in the previous embodiment and can be referred to each other. They will not be repeated here.

[0174] In this embodiment of the application, the action space 710 can be used to specify the action of adjusting the physical parameters corresponding to the photonic crystal each time. For example, action 0 can be specified as increasing a certain physical parameter by 10%, action 1 as decreasing a certain physical parameter by 10%, action 2 as increasing a certain physical parameter by 0.5%, action 3 as decreasing a certain physical parameter by 0.5%, and action 4 as not modifying any physical parameter.

[0175] In this embodiment, the state space 711 can be used to define the physical parameters of the photonic crystal. Specifically, the state space 711 can be determined according to the structure of the photonic crystal to be generated. For example, the state space may include:

[0176] State = [w1, w2, w3...]

[0177] S 3×4 ′={(ε a ,ε b ,ε c ,ε d ),(μ a ,μ b ,μ c ,μ d ),(d a ,d b ,d c ,d d )}

[0178] Where State is the set of state values, and w in this set of state values ​​represents the bandgap structure corresponding to each photonic crystal, and S 3×4 ′ represents the set of physical parameters.

[0179] In this embodiment, the parameter decision module 712 can be used to obtain the execution actions set in the action space 710, and can decide the actions to be executed. For example, it can obtain action 2, which modifies a certain physical parameter by 2%. After applying action 2 to the physical parameter, it updates the parameters in the state space 711 and waits to receive the next execution action.

[0180] In this embodiment, the reward function 713 can be used to calculate a reward value based on the bandgap structure. Specifically, after calculating the reward value, the reward value and the corresponding bandgap structure are sent to the agent 70. After calculating the reward value, the reward function 713 can also determine whether to store the reward value in the corresponding queue by comparing the reward value calculated each time with the numerical values ​​of other reward values ​​in a pre-set first reward value queue and a second reward value queue.

[0181] In this embodiment of the application, the intelligent agent 70 can be used to select an action in the action space 710 based on the received bandgap structure and adjust the physical parameters.

[0182] In one possible implementation of this application, such as Figure 7 As shown, in the action space 710, the A portion of the photonic crystal is manipulated, causing a change in the thickness of A.

[0183] In this embodiment of the application, the deep neural network model 72 can be used to calculate the bandgap structure corresponding to the photonic crystal based on the physical parameters of the photonic crystal.

[0184] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0185] like Figure 9 The diagram shown is a schematic of a photonic crystal design device provided in an embodiment of this application. Specifically, it may include a determination module 90, a dataset generation module 91, a training module 92, a model building module 93, and an output module 94, wherein:

[0186] The determination module 90 is used to determine the structure of the photonic crystal to be generated;

[0187] The dataset generation module 91 is used to generate a dataset based on the structure, wherein any data in the dataset conforms to the structural requirements of the structure.

[0188] Training module 92 is used to train a deep neural network model using this dataset;

[0189] Model building module 93 is used to build a reinforcement learning model, which includes an agent;

[0190] Output module 94 is used to output multiple prediction structures using the agent and the deep neural network model, each of which contains a corresponding bandgap structure.

[0191] In this embodiment of the application, the output module 94 is specifically used for:

[0192] Based on the first physical parameters preset by the photonic crystal, the first bandgap structure is calculated by calling the deep neural network model.

[0193] Based on the first bandgap structure, the agent is invoked to adjust the first physical parameter to obtain the second physical parameter;

[0194] Based on this second physical parameter, the deep neural network model is called to calculate multiple bandgap structures;

[0195] Calculate the reward value for each of the multiple bandgap structures;

[0196] Based on the reward value, multiple prediction structures are output.

[0197] In this embodiment of the application, the output module 94 is specifically used for:

[0198] Based on this second physical parameter, the deep neural network model is called to calculate a new bandgap structure;

[0199] Based on the new bandgap structure obtained each time, the agent is invoked to adjust the physical parameters corresponding to the new bandgap structure to obtain new physical parameters;

[0200] Based on these new physical parameters, the deep neural network model was invoked to calculate multiple bandgap structures.

[0201] In this embodiment of the application, the output module 94 is specifically used for:

[0202] Determine the desired bandgap structure, which includes the target upper endpoint value and the target lower endpoint value;

[0203] Calculate the difference between the upper endpoint value of each bandgap structure and the upper endpoint value of the target;

[0204] Calculate the difference between the lower endpoint value of each bandgap structure and the lower endpoint value of the target lower endpoint;

[0205] The reward value for each bandgap structure is calculated based on the difference between the upper and lower endpoints. This reward value is used to evaluate the degree of closeness between the desired bandgap structure and each bandgap structure.

[0206] In this embodiment of the application, the output module 94 is specifically used for:

[0207] When the reward value of this bandgap structure is calculated for the first time, the reward value of the bandgap structure is stored in the preset first reward value queue;

[0208] When the reward value of any bandgap structure is calculated, it is determined whether to store the reward value of the bandgap structure into the first reward value queue based on the relationship between the reward value of the bandgap structure and the reward values ​​in the first reward value queue.

[0209] When the number of times the physical parameters corresponding to the bandgap structure are adjusted reaches a preset threshold, if the maximum value in the first reward value queue is less than the minimum value in the second reward value queue, then the maximum value in the first reward value queue is stored in the second reward value queue.

[0210] The second reward value queue outputs multiple prediction structures.

[0211] In this embodiment of the application, the output module 94 is specifically used for:

[0212] The calculated reward value of the bandgap structure is compared with each reward value in the first reward value queue.

[0213] When the calculated reward value of the bandgap structure is greater than the maximum value in the first reward value queue, the calculated reward value of the bandgap structure is stored in the first reward value queue.

[0214] When the calculated reward value of the bandgap structure is less than or equal to the maximum value in the first reward value queue, the calculated reward value of the bandgap structure is discarded.

[0215] In this embodiment of the application, the output module 94 is further configured to:

[0216] Based on the first bandgap structure, determine the type of parameter to be adjusted in the first physical parameter, and the corresponding adjustment value of the parameter type;

[0217] The first physical parameter is adjusted according to the parameter type and the adjustment value to obtain the second physical parameter.

[0218] In this embodiment of the application, the output module 94 is further configured to:

[0219] Based on the reward value for each bandgap structure, the agent's agent settings parameters are adjusted.

[0220] As the apparatus embodiments are basically similar to the method embodiments, they are described in a relatively simple manner. For relevant details, please refer to the description in the method embodiment section.

[0221] Reference Figure 10 The diagram illustrates a computer device provided in an embodiment of this application. Figure 10 As shown, the computer device 1000 in this embodiment includes a processor 1010, a memory 1020, and a computer program 1021 stored in the memory 1020 and executable on the processor 1010. When the processor 1010 executes the computer program 1021, it implements the steps in the various embodiments of the photonic crystal design method described above, for example... Figure 1 The steps S101 to S105 are shown. Alternatively, when the processor 1010 executes the computer program 1021, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 9 The functions of modules 90 to 94 are shown.

[0222] For example, the computer program 1021 can be divided into one or more modules / units, which are stored in the memory 1020 and executed by the processor 1010 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing a specific function, and these instruction segments can be used to describe the execution process of the computer program 1021 in the computer device 1000. The computer device 1000 may include, but is not limited to, the processor 1010 and the memory 1020. Those skilled in the art will understand that... Figure 10 This is merely one example of computer device 1000 and does not constitute a limitation on computer device 1000. It may include more or fewer components than shown, or combine certain components, or different components. For example, computer device 1000 may also include input / output devices, network access devices, buses, etc.

[0223] The processor 1010 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0224] The memory 1020 can be an internal storage unit of the computer device 1000, such as a hard disk or RAM of the computer device 1000. The memory 1020 can also be an external storage device of the computer device 1000, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc., equipped on the computer device 1000. Furthermore, the memory 1020 can include both internal and external storage units of the computer device 1000. The memory 1020 is used to store the computer program 1021 and other programs and data required by the computer device 1000. The memory 1020 can also be used to temporarily store data that has been output or will be output.

[0225] This application also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the photonic crystal design method as described in the foregoing embodiments.

[0226] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A photonic crystal design method, characterized in that, include: Determine the structure of the photonic crystal to be generated; Based on the structure, a dataset is generated, wherein any data in the dataset conforms to the structural requirements of the structure. The dataset was used to train a deep neural network model; Construct a reinforcement learning model, wherein the reinforcement learning model includes an agent; Using the intelligent agent and the deep neural network model, multiple prediction structures are output, and each prediction structure contains a corresponding bandgap structure. The agent and the deep neural network model are used to output multiple prediction structures, including: Based on the first physical parameters preset by the photonic crystal, the first bandgap structure is calculated by calling the deep neural network model. Based on the first bandgap structure, the agent is invoked to adjust the first physical parameters to obtain the second physical parameters; Based on the second physical parameter, the deep neural network model is invoked to calculate multiple bandgap structures; Calculate the reward value for each of the multiple bandgap structures; Based on the reward value, multiple prediction structures are output; The step involves outputting multiple prediction structures based on the reward value, including: When the reward value of the bandgap structure is calculated for the first time, the reward value of the bandgap structure is stored in a preset first reward value queue. When the reward value of any of the bandgap structures is calculated, it is determined whether to store the reward value of the bandgap structure into the first reward value queue based on the relationship between the reward value of the bandgap structure and each reward value in the first reward value queue. When the number of times the physical parameters corresponding to the bandgap structure are adjusted reaches a preset threshold, if the maximum value in the first reward value queue is less than the minimum value in the second reward value queue, then the maximum value in the first reward value queue is stored in the second reward value queue. Multiple prediction structures are output based on the second reward value queue.

2. The method according to claim 1, characterized in that, The dataset includes the physical parameters corresponding to the photonic crystal; Each of the aforementioned photonic crystals is composed of multiple layers of different materials; The physical parameters include the dielectric constant, and / or magnetic permeability, and / or thickness of each layer of the photonic crystal.

3. The method according to claim 1, characterized in that, Based on the second physical parameters, the deep neural network model is used to calculate multiple bandgap structures, including: Based on the second physical parameters, a new bandgap structure is calculated by calling the deep neural network model; Based on the new bandgap structure obtained each time, the agent is invoked to adjust the physical parameters corresponding to the new bandgap structure to obtain new physical parameters; Based on the new physical parameters, the deep neural network model is invoked to calculate multiple bandgap structures.

4. The method according to claim 1, characterized in that, The calculation of the reward values ​​for the plurality of bandgap structures includes: Determine the desired bandgap structure, which includes a target upper endpoint value and a target lower endpoint value; Calculate the difference between the upper endpoint value of each bandgap structure and the upper endpoint value of the target upper endpoint; Calculate the difference between the lower endpoint value of each bandgap structure and the lower endpoint value of the target lower endpoint value; A reward value for each bandgap structure is calculated based on the difference between the upper endpoint and the difference between the lower endpoint. The reward value is used to evaluate the degree of closeness between the desired bandgap structure and each bandgap structure.

5. The method according to claim 1, characterized in that, The step of determining whether to store the reward value of the bandgap structure into the first reward value queue based on the relationship between the reward value of the bandgap structure and the reward values ​​in the first reward value queue includes: The calculated reward value of the bandgap structure is compared with each reward value in the first reward value queue; When the calculated reward value of the bandgap structure is greater than the maximum value in the first reward value queue, the calculated reward value of the bandgap structure is stored in the first reward value queue. When the calculated reward value of the bandgap structure is less than or equal to the maximum value in the first reward value queue, the calculated reward value of the bandgap structure is discarded.

6. The method according to any one of claims 3-5, characterized in that, The step of invoking the agent to adjust the first physical parameters based on the first bandgap structure to obtain the second physical parameters includes: Based on the first bandgap structure, determine the type of parameter to be adjusted in the first physical parameters, and the adjustment value corresponding to the parameter type; The first physical parameter is adjusted according to the parameter type and the adjustment value to obtain the second physical parameter.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the photonic crystal design method as described in any one of claims 1-6.

8. A storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the photonic crystal design method as described in any one of claims 1-6.