Similar circuit dynamic behavior modeling method based on transfer learning deep operator network

By combining transfer learning with DeepONet, the problem of high data demand in circuit dynamic behavior modeling is solved, efficient and robust circuit dynamic behavior modeling is achieved with a small amount of data, and the adaptability and accuracy are significantly improved.

CN118761369APending Publication Date: 2024-10-11NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410758393.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing circuit dynamic behavior modeling methods based on deep operator networks require a large amount of label data, and the data collection cost is high in multi-scale or high-fidelity scenarios, resulting in limited prediction performance, especially in the case of small amounts of data, it is difficult to achieve effective modeling. .

Method used

Combining transfer learning with DeepONet, by training the model on the source domain and transferring feature knowledge to the target domain, using the same form of excitation function to model multiple similar circuits, effective dynamics can still be achieved even when the target domain has only a small amount of data. Behavioral modeling.

Benefits of technology

It reduces the cost of data collection, improves the modeling accuracy and robustness under a small amount of data, significantly improves adaptability, maintains high performance in small sample situations, and avoids overfitting and gradient disappearance problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118761369A_ABST
    Figure CN118761369A_ABST
Patent Text Reader

Abstract

The invention discloses a similar circuit dynamic behavior modeling method based on a transfer learning deep operator network, and belongs to the field of circuit state estimation. The method mainly comprises the steps of selecting and generating a circuit excitation function f (t), collecting a real value y (t) of a circuit response function, obtaining an optimal source model, constructing a mixed loss function, transferring source model parameters and finely adjusting target model network parameters. The method has the advantages that the advantages of TL and DeepONet are fully combined, compared with DeepONet, dynamic behavior modeling of an approximation circuit is completed with lower data acquisition cost and fewer iterations, and the method has remarkable advantages in the aspects of precision, robustness and adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Field

[0002] The present invention relates to the field of circuit state estimation, and more specifically to the application field of similar circuit dynamic behavior modeling based on deep migration operator networks. Background Art

[0003] Taking power electronic systems (PES) as an example, the existing technologies for electronic circuit state estimation are explained. PES modeling and state monitoring methods can generally be divided into two categories: circuit modeling and data-driven methods. Starting from the internal mechanism of the electronic circuit, the process of establishing its mathematical model based on basic scientific laws and equations such as energy conservation, Kirchhoff's voltage law, and Kirchhoff's current law is called mechanism modeling; Azer P et al. used state space averaging (SSA) to model the converter mechanism in "Generalized state space average model for multi-phase interleaved buck, boostandbuck-boostDC-DC converters: Transient, steady-state and switching dynamics".

[0004] Research on electronic circuit status monitoring can be divided into circuit degradation parameter identification, anomaly detection, remaining life prediction, fault diagnosis and circuit fault location. Soliman H used artificial neural network to estimate the circuit capacitance value in "Capacitance estimation for dc-link capacitors in a back-to-back converter based on artificial neural network algorithm". Jiang Y et al. used Gaussian process regression and genetic algorithm to identify the abnormal state of DC-DC converter in "Online anomaly detection in DC / DC converters by statistical feature estimation using GPR and GA".

[0005] The new Deep Operator Network (DeepONet) algorithm proposed in 2021 can be used to model the dynamic behavior of analog circuits. However, this method is purely data-driven and requires sufficient training data. In many cases, especially when considering high-fidelity or multi-scale models, the difficulty and cost of collecting large-scale and sufficiently labeled data sets are often difficult to estimate. Therefore, the predictive performance of purely data-driven models is often limited by the availability of labeled data for training; in addition, isolated and repeated learning, that is, training a single predictive model for separate but related tasks, can cost a lot of resources. Summary of the invention

[0006] In view of the above problems, the present invention proposes a framework combining transfer learning (TL) with DeepONet. Considering that the use of DeepONet to model a single circuit behavior needs to be based on different forms of activation functions f(t), that is, a large number of circuit response label values ​​need to be solved in advance, and the f(t) used when modeling multiple related circuits is consistent, a method based on a transfer learning deep operator network (Deep Operator Network Based on TransferLearning, TL-DeepONet) is proposed to learn multiple similar circuit behaviors. It can utilize feature knowledge between related fields, and the model information trained on a specific domain (source domain) with sufficient label data can be transferred to a different but closely related field (target domain). Even if only a small amount of training data is available in the target domain, the expected effect can still be achieved.

[0007] The technical solution of the present invention is: for a certain circuit, its dynamic behavior modeling under the nominal value of the circuit device is called the source task, and the dynamic behavior modeling of the circuit that is different but related to it is called the target task. For example, when the value of a certain device in the circuit changes or the circuit response is taken at different circuit position points, the corresponding models of the two are called the source model and the target model.

[0008] The overall process framework of the present invention is as follows Figure 1 As shown in the figure, the main steps are to select and generate the circuit excitation function f(t), collect the true value y(t) of the circuit response function, obtain the best source model, build a hybrid loss function, transfer the source model parameters, and fine-tune the target model network parameters.

[0009] Step 1: Select and generate circuit excitation function f(t);

[0010] In the present invention, the idea of ​​the radial basis function (RBF) kernel function in the Gaussian fitting process is used to generate a series of different circuit excitation functions f(t) from the Gaussian random field (GRF), such as the formula

[0011]

[0012] in

[0013]

[0014] represents a Gaussian process, that is, f(t) has a mean of 0 and a covariance of k l (t, t'). Where t and t' are the time points of f(t), l (length-scale) is the length scale parameter, which determines the complexity of f(t), and k l (t, t') refers to the radial basis function kernel used in the Gaussian process to describe the correlation between different time points; follow this step to generate the source domain f S (t) and the label f ​​in the target domain TL (t) and the unlabeled f UL (t).

[0015] Step 2: Collect the true value y(t) of the circuit response function;

[0016] For the case where the circuit response is a zero-state response, that is, y(t) in the above becomes y zs (t). The circuit contains Kirchhoff's laws of physics such as voltage or current, and the circuit's f(t) and y zs (t) can be explicitly expressed by the partial differential equation under the law. For each f generated in step 1 S (t) and f TL (t), the corresponding circuit response function true value y can be obtained by using the model discretization, that is, the numerical integration method of the differential equation zs (t), which includes the source domain y required by the source task zs S (t) and the target domain y required by the target task zsi TL (t), so we get the source domain label dataset Target domain dataset N S is the number of source domain samples, N TL With N UL are the number of labeled samples and the number of unlabeled samples in the target domain, respectively.

[0017] Step 3: Obtain the best source model, including the following sub-steps:

[0018] Sub-step 1: Source domain circuit activation function f S (t) Pretreatment:

[0019] Assuming that x follows a Gaussian distribution with mean μ and standard deviation σ, the standardized data can be calculated using the following formula:

[0020]

[0021] The input of the branch network is adopted, that is, f S (t) is preprocessed to satisfy the standard normal distribution.

[0022] Sub-step 2: Establish the initial DeepONet source model structure;

[0023] The time domain transfer characteristics of the circuit can be expressed by the formula,

[0024] G f (t):f(t)→y zs (t) (4)

[0025] G f (t) is called an operator.

[0026] The special structure of the model of the present invention is that it uses two independent sub-networks: an upstream branch network and a downstream trunk network. The branch network is used to process f(t) and adopts a simple form of discrete sampling points [f(t 1 ),f(t 2 ),...,f(t m )] approximately represents f(t) and serves as the input of the branch network, m is the number of discrete sampling points; y zs The time point t of (t) is used as the input of the backbone network. After being processed by several fully connected layers, the dot product is performed to finally obtain the circuit response prediction value at any time t corresponding to each f(t).

[0027] Figure 1 The dotted box above is the DeepONet source model, whose branch network consists of a one-dimensional convolutional layer and a fully connected layer. The convolutional layer is used to extract f S (t) features, which is convenient for the target model to use; the backbone network uses a simple form of fully connected network, and the output results of the two are dot-producted to obtain each f S The circuit response prediction value G under (t) S (f S (t))(w S ,b S ), where G S is the source domain operator, wS and b S are the network parameters of the source model.

[0028] Sub-step 3: source model training and updating;

[0029] Using the source domain dataset obtained in step 2 Perform training. Assume that the number of samples is N S Large enough, the mean square error (MSE) regression loss L is used during training r , such as,

[0030]

[0031] Where n is each y zsi S (t) is the number of sampling time points on the graph. After multiple iterations of training, when the MSE is less than a specific threshold, the model training is completed, which is equivalent to learning G S , and save the best network parameters of the source model and

[0032] Step 4: Construct a hybrid loss function, including the following sub-steps:

[0033] Sub-step 1: Calculate the target task regression loss

[0034] Figure 1 The target model is in the dashed box below, which is used to model similar circuits. For labeled data, use Use MSE as regression loss L r To train the model, w T and b T is the network parameter of the target model, G T is the target domain operator, G Ti (f TL (t k )) for each f TL The predicted value of the circuit response under (t) is shown in Eq.

[0035]

[0036] Where n is each y zsi TL (t) is the number of sampling time points on .

[0037] Sub-step 2: Introducing Conditional Embedding Operator Discrepancy (CEOD)

[0038] For unlabeled data The present invention uses CEOD to measure the conditional distribution difference between labeled data and unlabeled data in the target data. By computing the Hilbert-Schmidt norm of the empirical conditional embedding operator for the two distributions Then calculate the difference as another CEOD loss term L CEOD The global properties of the conditional distribution dominated by the labeled target data are taken into account.

[0039] To calculate D CEOD ,like Figure 1 As shown by the purple dotted line, the output b of the first fully connected layer of the branch network f1 (f TL (t)) and b f1 (f UL (t)) as a random variable X TL and X UL , with label data y zs TL and the network output value G T (f j TU ) as a random variable Y TL and Y UL , and calculated by and The conditional distribution of .

[0040]

[0041] Where Φ(y zs TL (t)) and For zs TL (t) and b f1 (f TL (t)) related matrix can be expressed as

[0042]

[0043] Calculated. φ(x) and ψ(y) are the mappings of x and y from the original space to the reproducing kernel Hilbert space respectively. is called an operator, η is a very small constant, I is the unit matrix, and ηI can be regarded as regularization. is the Gram matrix, which can be obtained by using the Gaussian kernel K XX' (i,j)=k(x i ,x j ) calculated.

[0044] Sub-step 3: Determine the weighting coefficient

[0045] Based on sub-steps 1 and 2, the hybrid loss function Lh as follows:

[0046]

[0047] λ 1 and λ 2 The present invention adopts a method for determining the weight coefficients of the two subtasks based on the uncertainty of multiple tasks.

[0048] For regression tasks, the likelihood is defined as the network output f w,b (x) is the expected Gaussian likelihood, that is:

[0049] p(y|f w,b (x)) = N(f w,b (x),λ) (10)

[0050] Where y is the label value and λ is the weighting coefficient. Then the likelihood of the multi-task model is:

[0051] p(y 1 ,...,y k |f w,b (x)) = p(y 1 |f w,b (x))...p(y k |f w,b (x)) (11)

[0052] Its log-likelihood is:

[0053]

[0054] The TL-DeepONet model optimizes two tasks simultaneously: data fitting regression and global distribution matching. Assume that the output label values ​​are y 1 and 2 , then the total log-likelihood is calculated as:

[0055]

[0056] Take the logarithm:

[0057]

[0058] If you want to minimize the negative log-likelihood, you need to adjust λ 1 and λ 2 The value of λ 1 Increase, L r The last term logλ 1 λ 2 can be regarded as a regularization term.

[0059] Step 5: Source model parameter transfer;

[0060] In the source model and This includes the weights of the convolutional layer and deviation And the weights of the fully connected layer and deviation The results are directly transferred to the target model with the same structure as the source model as the initialization parameters of the target model, which is called TL-DeepONet.

[0061] Step 6: Fine-tune the target model network parameters;

[0062] like Figure 1 As shown in the black and red lines, after initializing the target model parameters by transferring the source model parameters, the convolutional layer parameters are frozen and the hybrid loss function L is minimized. h The parameters of all fully connected layers in the TL-DeepONet branch network and the last layer of the backbone network are updated. At the same time, in order to avoid overfitting when some parameters are far away from their starting point, different weights are set for different layers, and a consistent learning rate is used during the iteration process. h When is less than a certain threshold, the dynamic behavior of similar circuits is modeled.

[0063] The beneficial effects of the present invention are as follows: the present invention fully combines the advantages of TL and DeepONet. Compared with DeepONet, the present invention completes the dynamic behavior modeling of the approximate circuit with lower data acquisition cost and fewer iterations, and has significant advantages in accuracy, robustness and adaptability. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 TL-DeepONet idea diagram

[0065] Figure 2 TL-DeepONet Flowchart

[0066] Figure 3 Multisim simulation diagram of second-order bandpass filter

[0067] Figure 4 Inverting input type KHN filter signal flow chart

[0068] Figure 5 Inverting input type KHN filter circuit design schematic diagram

[0069] Figure 6 Error trend plot of source model

[0070] Figure 7 Error comparison under large samples

[0071] Figure 8 Error comparison under small samples

[0072] Fig. 9 N T =200 and N T =100 when the error comparison

[0073] Fig.10 MSE comparison of DeepONet under different lr and batch

[0074] Fig.11 MSE comparison of TL1-DeepONet under different lr and batch

[0075] Fig.12 Comparison of effects under different lr and batch Specific embodiments

[0076] In this embodiment, the similar circuit dynamic behavior modeling method based on transfer learning deep operator network adopts two specific examples.

[0077] First, take the second-order bandpass filter circuit as an example, Figure 3 Assuming the resistor R 1 and R 3 rises to 110% of the nominal value or drops to 90%, the capacitor C 1 and C 2 When it drops to 90% of the nominal value, it is determined that the device fails or the circuit fails, and 110% and 90% of the nominal value are called critical failure values. Based on this setting, the present invention takes the dynamic modeling under the nominal value of the filter as the source task, establishes a normal circuit model through DeepONet, takes the dynamic modeling of a single device failure and other device values ​​within the normal range as the target task, and establishes a failure circuit model when a single device fails through TL-DeepONet. In order to meet the actual situation of the circuit, when generating data of the failed circuit, the single device value is set to the critical failure value, and the other device values ​​float within the range of 3% to 4% of the nominal value.

[0078] Secondly, the state filter (also known as the KHN filter) uses three or four op amps and combines two feedback loops to achieve high-pass filtering, band-pass filtering, and low-pass filtering at multiple output points. The signal flow principle and circuit design of the inverting input KHN filter are as follows: Figure 4 and Figure 5 The frequency domain transfer functions of the high-pass, band-pass, and low-pass responses are

[0079]

[0080] A 1 To A5 is a constant, s is a Laplace variable, and its corresponding time domain responses are y zs hp (t), y zs bp (t) and y zs lp (t). With bandpass response y zs bp (t) is learned as the source task, and the other two responses are taken as the target tasks. The target task is actually equivalent to further learning the differential and integral operators based on the source model, which is simpler than circuit modeling.

[0081] The difference between the source task and the target task can be visualized by the impulse response h(t) of the circuit, as shown in Tables 1 and 2.

[0082] Table 1 Model output and difference visualization of bandpass filter

[0083]

[0084] Table 2 KHN model output and difference visualization

[0085]

[0086]

[0087] Distribution Difference Measurement and Hyperparameter Setting

[0088] For the source models of the two instances and the corresponding target models, under the same f(t), generate the source domain and the target domain N S train =N T train = 3000 sets of training samples and N S test =N S test = 1000 test samples. The distribution of the label values ​​of the source task and the corresponding single target task is different. We select 3000 sets of data and use the formula and formula respectively.

[0089]

[0090] Calculate the maximum mean discrepancy (MMD) and To measure the relevance of the source task and the target task, where X and Y represent the labels y of the source task and the target task respectively. zs (t), m and n are respectively zsThe number of sampling points on (t). The calculation results are shown in Table 3.

[0091] Table 3 Distribution difference values ​​between source data and different target data

[0092]

[0093]

[0094] The corresponding network structure settings are shown in Table 4, where N is the number of samples in the training set, and p is the number of neurons in the last layer of the branch network and the backbone network.

[0095] Table 4 Network structure hyperparameters of two examples

[0096]

[0097] For the KHN filter, the distribution difference is larger, so better results are obtained by increasing the network width of its adjustable fully connected layer. In order to ensure that the learning of the source task has sufficient complexity, the device parameters in the circuit are set so that the H of KHN b (s) is the same as the expression in step 4.

[0098] Effects of the Embodiments

[0099] This invention fully combines the advantages of TL and DeepONet. On the one hand, through the implementation of the bandpass filter circuit, the effects of DeepONet and TL-DeepONet are compared and analyzed in large and small sample situations, especially for small samples, when DeepONet is not applicable, the latter still maintains excellent performance; compared with other methods, it explains the necessity of adding CEOD on the basis of TL-DeepONet (for easy distinction, it is called TL-DeepONet-CEOD), which shows strong robustness for random selection of training data in small sample situations. On the other hand, through the implementation of the KHN circuit, the flexibility of TL-DeepONet-CEOD in adjusting task-specific layers is explained.

[0100] 1 Method effectiveness analysis

[0101] In order to more intuitively represent the time series prediction value of the circuit dynamic model and the true value y ij The deviation between them is calculated, and MSE and mean absolute percentage error (MAPE) are used as the error evaluation indicators of the model.

[0102]

[0103] (1) Establishment of the source model (DeepONet)

[0104] In order to generate the source model, according to the setting of the network structure in Table 4, use N S train = 3000 sample data for training, and S test = Tested on 1000 sample data.

[0105] (2) Establishment of target model

[0106] Among the six related target tasks, the MMD and CEOD values ​​of TL1 are at a medium level, so TL1 (R 1 =4400Ω) is the main research object, and the visualization and other detailed descriptions are given. First, consider not adding CEOD, that is, using a single regression loss L r The target model is trained to provide a benchmark for subsequent comparisons. For convenience, this model is called TL1-DeepONet.

[0107] For the target task, two models, DeepONet and TL1-DeepONet, are used. To evaluate the impact of training sample size on model performance, N T train ={100, 200, 300, 500, 1000, 2000, 3000} groups of samples are used for training. To ensure the credibility of subsequent effect comparison, the large sample contains all the data of the small sample. In addition, in order to compare the convergence speed of the model, when the training sample sizes of the two models are the same, the value of the number of iterations epoch is used as the time cost evaluation indicator.

[0108] Assume that the data size is N T train =1000 and above is a large sample scenario, N T train =500 and N T train =300 is a small sample scenario (hereinafter referred to as N T train Abbreviated as N T ).

[0109] 1) Analyze from the perspective of loss trend chart.

[0110] Figure 6 and Figure 7 The performance comparison of the models with different target task training data sizes on the test set is shown respectively. The blue line represents DeepONet and the orange line represents TL1-DeepONet. Both are models trained with dynamically changing learning rates.

[0111] pass Figure 7The analysis can conclude that in large sample scenarios, TL1-DeepONet converges faster and its accuracy is generally higher than DeepONet.

[0112] (a) For N T =3000, the loss value of TL1-DeepONet is smaller than that of DeepONet during the entire training process, and the MAPE of TL1-DeepONet is stable below 5%;

[0113] (b) For N T =2000 and below. Although the accuracy of DeepONet and TL1-DeepONet is comparable in the later stages of iteration, the MSE of TL1-DeepONet has dropped to 1e-7 around epoch=25000, and subsequently stabilized in the range of 9×e-7 to 1×e-6. Its MAPE has also dropped below 10%. The corresponding DeepONet will reach the same level only at epoch=70000.

[0114] pass Figure 8 The analysis shows that in the case of small samples, the DeepONet method is no longer applicable, while TL1-DeepONet can still maintain high accuracy. T =500 and N T =300, the test error of DeepONet is already quite high, beyond the acceptable range; however, when the error of TL1-DeepONet is around epoch=50000, it can maintain the same order of magnitude as the MSE in the large sample scenario, and the MAPE only increases by 1% to 2%, that is, the performance of TL1-DeepONet will not be significantly reduced due to the reduction in the amount of training data.

[0115] Depend on Fig. 9 It can be seen that for N T =200 and N T =100, DeepONet is already overfitting, and the MAPE of TL1-DeepONet exceeds 10%, so in this sample scenario, both models are not applicable.

[0116] 2) Analyze from the perspective of minimum error value.

[0117] Based on the randomness of the training process represented by running the model five times with different seed numbers, a fixed target model label data was selected in each training process. Table 5 shows the five average MSE and MAPE of DeepONet and TL1-DeepONet at different training sample sizes in the first TL scenario, as well as the corresponding epoch size (the epoch is taken from the case of minimum MAPE).

[0118] The following conclusions can be drawn from Table 5:

[0119] (a) In the large sample scenario, TL1-DeepONet has better generalization performance. The optimal models of DeepONet and TL1-DeepONet both appear at the end of training, and the corresponding epochs differ by about 20,000. TL1-DeepONet has a slight advantage over DeepONet in test error and is T When =3000, the MAPE of TL1-DeepONet drops below 1%;

[0120] (b) In the case of small samples, TL1-DeepONet can significantly save training time while ensuring accuracy. By designing the learning rate and batch training to ensure that DeepONet does not overfit, its MAPE is three times that of TL1-DeepONet; and for the same size of training data, its epoch number is much greater than that of TL1-DeepONet, especially when N is large. T When =300, the epoch size of TL1-DeepONet is only one fifth of that of DeepONet.

[0121] Table 5 Comparison of mean error and number of iterations under TL1

[0122]

[0123] Table 5-6 summarizes the comparison of the effects of 6 different circuit modeling related tasks.

[0124] Table 5-6 Comparison and summary of MAPE (%) under different related circuit modeling

[0125]

[0126] Combining 1) and 2), we can conclude that the source model parameters usually contain knowledge of the target domain (task) after being trained with sufficient source labeled data, so transferring the parameters of the relevant task can better initialize the target model and reduce the amount of labeled data and time required to train the target model from scratch. In addition, this method also solves the problem of overfitting or gradient vanishing when very few target samples are available.

[0127] 2 Analysis of the superiority of the method under small sample conditions

[0128] (1) LR and batch training hyperparameter adjustment

[0129] Considering all the situations in 1, T=300 is taken as the minimum threshold under the premise that TL1-DeepONet is available, and this sample size is taken as an example to further illustrate the situation with different lr and whether batch training is used. Fig.10 and Fig.11 The trend comparison of the two models under four different situations is shown.

[0130] Depend on Fig.11 It can be concluded that using a small amount of labeled data to train DeepONet from scratch usually leads to severe oscillations in the model, low accuracy, or gradient disappearance due to overly complex structures, while TL1-DeepONet performs relatively well in this regard.

[0131] 2) TL1-DeepONet target model with CEOD

[0132] When TL-DeepONet is applied to a small sample scenario, when the learning rate is constant and batch is not used (such as Fig.11 In order to solve this problem, we consider adding CEOD to take the global characteristics of the data into account during the training process. We refer to this model as TL1-DeepONet-CEOD. and The CEOD loss is calculated and L is changed according to the uncertainty quantification method. h The λ of λ makes the two loss terms dynamically adjust the performance of the model.

[0133] In addition to the above discussion, we further explore the adaptability and robustness of TL1-DeepONet-CEOD for label data selection. We select the first three migration scenarios as examples and compare them with other methods in Table 7.

[0134] Table 7 Specific operation steps of other benchmark models

[0135]

[0136] In each training process, the random seed is fixed, and 300 different sets of label data are randomly selected from the 3000 sets of training data in the target domain, and the selection is performed 10 times in total. At the same time, the remaining 2700 sets after each selection are combined. MMD or CEOD is calculated. The average error results corresponding to the best model under each method are shown in Table 8.

[0137] The following conclusions can be drawn from the data in Table 8:

[0138] 1) TL1-DeepONet achieves effective feature migration. The mean error of TL1-DeepONet and FA is significantly lower than that of Model 1 and DeepONet, which means that they achieve effective feature migration rather than the opposite migration, that is, they effectively utilize the knowledge of the source domain, thus achieving a significant improvement in model performance;

[0139] 2) TL1-DeepONet-CEOD is more robust to the distribution of target label data and is less prone to overfitting. Although the average performance of the FA model is the best among all methods, it shows that initializing the network parameters with source domain knowledge and directly fine-tuning the pre-trained model based on limited target label data can indeed achieve good performance; however, in terms of standard deviation, the observation that the std of FA is greater than that of TL1-DeepONet-CEOD shows that FA is more affected by the selection of target label data. In other words, when the distribution of a certain test data is very different from that of randomly selected training data, the error of this test data will become very large; and FA is equivalent to DeepONet initialized with feature knowledge, so it is similar to DeepONet in some cases and can easily cause overfitting or gradient disappearance;

[0140] 3) After adding CEOD, TL1-DeepONet-CEOD can make full use of f S (t) and f T The prior condition of “distribution consistency” of (t). TL1-DeepONet-MMD, which replaces CEOD with MMD, has a mean accuracy comparable to that of DeepONet and TL1-DeepONet-CEOD, but its stability is slightly worse than that of the latter, indicating that it only focuses on the label y of the target data when considering matching the global distribution. zs TL With unlabeled data G T (f j TU ) and ignores the difference of f S (t) and f T (t) “distribution consistency”;

[0141] 4) DAN is not applicable in this experimental case. The mean and std of the DAN error are similar to those of Model 1, indicating that the former only uses f S (t) and f T(t) The marginal distribution is adapted without involving the label value of the target data, so the distribution of the target label data will not affect DAN, which can explain why std is small. In this example, since the marginal distributions of the source domain and the target domain are similar (theoretically exactly the same), the embedded MMD will not affect the target model, so its performance is equivalent to directly using the source model for prediction.

[0142] Table 8 Mean and standard deviation of MSE and MAPE values ​​under different algorithms

[0143]

[0144]

[0145] In summary, in the case of small samples, whether N is fixed T The selection is still random selection N T ,TL-DeepONet has lower error and training time cost than DeepONet; and after adding CEOD, the model is more robust and applicable to the distribution and selection of target label data while maintaining accuracy and training cost, or in some cases, reducing accuracy. This verifies the effectiveness of CEOD and proves that it plays a significant role in TL for similar tasks under modeling conditional transfer.

[0146] 3 Flexibility Analysis of Adjustable Layers

[0147] (1) Selection of TL-DeepONet fine-tuning layer

[0148] In reference 2, TL-DeepONet is effective under small data. Under the premise of freezing the convolution layer parameters, that is, extracting features from f(t), we consider how to process (fine-tune or freeze) the fully connected layer parameters of the upper and lower branch networks to achieve the best migration effect. The following methods are trained ten times in two random situations, combined with the TL-HP (migration from bandpass to high-pass) example in Table 2, and TL-DeepONet-CEOD is trained on N T =300 case to analyze the experimental results:

[0149] Way 1: Fine-tune all fully connected layer parameters of the upper and lower branch networks, which is equivalent to not transferring the feature information of the output function at time point t;

[0150] Way 2: Parameters of the last two fully connected layers of the branch network and the backbone network;

[0151] Way 3: Fine-tune the parameters of all fully connected layers of the backbone network and the last fully connected layer of the branch network;

[0152] Method 4: Fine-tune the parameters of all fully connected layers of the branch network and the last fully connected layer of the backbone network;

[0153] From the data in Table 9, it can be concluded that, without changing the parameters of the source domain convolutional layer, the error is basically the same regardless of which fine-tuning method is selected, which shows the flexibility of TL-DeepONet-CEOD. In this example, Way 2 is selected.

[0154] Table 9 Mean values ​​of MSE and MAPE under different fine-tuning methods

[0155]

[0156] (2) Comparison of the effects of DeepONet and TL-DeepONet-CEOD

[0157] Fig.12 The figure shows the model effects under different hyperparameters. The left vertical axis represents MSE and the right represents MAPE. Because the vertical axis scale is logarithmic, the trends of MSE and MAPE are the same.

[0158] Depend on Fig.12 It can be concluded that for the learning of target tasks under small samples, although the distribution difference between the source domain and the target domain in KHN is large, by increasing the complexity of the fully connected layer, TL-DeepONet-CEOD can still achieve a prediction accuracy of MAPE below 1%; relatively speaking, using the DeepONet method to model from scratch will always lead to overfitting.

Claims

1. A method for modeling dynamic behavior of similar circuits based on transfer learning deep operator network, characterized in that: The main steps are as follows: Step 1: Select and generate circuit excitation function f(t): A series of different circuit excitation functions f(t) are generated from the Gaussian Random Field (GRF), as shown in the formula in represents a Gaussian process, that is, f(t) has a mean of 0 and a covariance of k l (t, t'); where t and t' are the time points of f(t), l (length-scale) is the length scale parameter that determines the complexity of f(t), and k l (t, t') refers to the radial basis function kernel used in the Gaussian process to describe the correlation between different time points; follow this step to generate the source domain f S (t) and the label f ​​in the target domain TL (t) and the unlabeled f UL (t); Step 2: Collect the true value y(t) of the circuit response function: For the case where the circuit response is a zero-state response, that is, y(t) in the above becomes y zs (t); The circuit contains Kirchhoff's laws of physics such as voltage or current, and the circuit's f(t) and y zs (t) can be explicitly expressed by the partial differential equation under the law; for each step one generated f S (t) and f TL (t), the corresponding circuit response function true value y can be obtained by using the model discretization, that is, the numerical integration method of the differential equation zs (t), which includes the source domain y required by the source task zs S (t) and the target domain y required by the target task zsi TL (t), so we get the source domain label dataset Target domain dataset N S is the number of source domain samples, N TL With N UL are the number of labeled samples and the number of unlabeled samples in the target domain respectively; Step 3: Obtain the best source model, including the following sub-steps: Sub-step 1: Source domain circuit activation function f S (t) pretreatment; Assuming that x follows a Gaussian distribution with mean μ and standard deviation σ, the standardized data can be calculated using the following formula: The input of the branch network is adopted, that is, f S (t) performing preprocessing to make it satisfy the standard normal distribution; Sub-step 2: Establish the initial DeepONet source model structure; The time domain transfer characteristics of the circuit can be expressed by the formula, G f (t):f(t)→y zs (t) (4) G f (t) is called an operator; The initial DeepONet source model structure uses two independent sub-networks: an upstream branch network and a downstream backbone network; the branch network is used to process f(t) and uses a simple form of discrete sampling points [f(t1),f(t2),...,f(t m )] approximately represents f(t) and serves as the input of the branch network, m is the number of discrete sampling points; y zs The time point t of (t) is used as the input of the backbone network. After being processed by several fully connected layers, the dot product is performed to finally obtain the circuit response prediction value at any time t corresponding to each f(t). The branch network of the DeepONet source model consists of a one-dimensional convolutional layer and a fully connected layer. The convolutional layer is used to extract f S (t) features, which is convenient for the target model to use; the backbone network uses a simple form of fully connected network, and the output results of the two are dot-producted to obtain each f S The circuit response prediction value G under (t) S (f S (t))(w S ,b S ), where G S is the source domain operator, w S and b S are the network parameters of the source model; Sub-step 3: source model training and updating; Using the source domain dataset obtained in step 2 Perform training; assuming the number of samples is N S Large enough, the mean square error (MSE) regression loss L is used during training r , such as, Where n is each y zsi S (t) is the number of sampling time points on the graph; after multiple iterations of training, when the MSE is less than a specific threshold, the model training is completed, which is equivalent to learning G S , and save the optimal network parameters w of the source model S* and b S* ; Step 4: Construct a hybrid loss function Sub-step 1: Calculate the target task regression loss The target model is used to model similar circuits; for labeled data, use Use MSE as regression loss L r To train the model, w T and b T is the network parameter of the target model, G T is the target domain operator, G Ti (f TL (t k )) for each f TL (t) The predicted value of the circuit response under the condition of Where n is each y zsi TL (t) The number of sampling time points on the graph; Sub-step 2: Introducing Conditional Embedding Operator Discrepancy (CEOD) For unlabeled data The present invention uses CEOD to measure the conditional distribution difference between labeled data and unlabeled data in the target data. By computing the Hilbert-Schmidt norm of the empirical conditional embedding operator for the two distributions Then calculate the difference as another CEOD loss term L CEOD Taking into account the global properties of the conditional distribution dominated by the labeled target data; To calculate D CEOD , the output b of the first fully connected layer of the branch network f1 (f TL (t)) and b f1 (f UL (t)) as a random variable X TL and X UL , with label data y zs TL and the network output value G T (f j TU ) as a random variable Y TL and Y UL , and calculated by and The conditional distribution of ; Where Φ(y zs TL (t)) and For zs TL (t) and b f1 (f TL (t)) related matrix can be expressed as It is calculated that φ(x) and ψ(y) are the mappings of x and y from the original space to the reproducing kernel Hilbert space respectively; is called an operator, η is a very small constant, I is the unit matrix, and ηI can be regarded as regularization. is the Gram matrix, which can be obtained by using the Gaussian kernel K XX' (i,j)=k(x i ,x j ) is calculated; Sub-step 3: Determine the weighting coefficient Based on sub-steps 1 and 2, the hybrid loss function L h as follows: λ1 and λ2 are weight coefficients of the two. The present invention adopts a method for determining the weight coefficients of the two subtasks based on the uncertainty of multiple tasks; For regression tasks, the likelihood is defined as the network output f w,b (x) is the expected Gaussian likelihood, that is: p(y|f w,b (x))=N(f w,b ( x ), λ ) ( 10 Where y is the label value and λ is the weighting coefficient; then the likelihood of the multi-task model is: p(y1,...,y k |f w,b (x))=p(y1|f w,b (x))...p(y k |f w,b (x)) (11) Its log-likelihood is: The TL-DeepONet model optimizes the two tasks of data fitting regression and global distribution matching at the same time. Assuming that the output label values ​​are y1 and y2 respectively, the total log-likelihood is calculated as: Take the logarithm: If you want to minimize the negative log-likelihood, you need to adjust the values ​​of λ1 and λ2; if λ1 increases, L r The last term logλ1λ2 can be regarded as a regularization term. Step 5: Source model parameter transfer; The w in the source model S* and b S* , which includes the weights w of the convolutional layer c S* and deviation b c S* , and the weights w of the fully connected layer f S* and deviation b f S* , directly transferred to the target model with the same structure as the source model as the initialization parameters of the target model, which is called TL-DeepONet; Step 6: Fine-tune the target model network parameters; As shown in the black and red lines in Figure 1, after initializing the target model parameters by transferring the source model parameters, the convolutional layer parameters are frozen and the hybrid loss function L is minimized. h The parameters of all fully connected layers in the TL-DeepONet branch network and the last layer of the backbone network are updated; at the same time, in order to avoid overfitting when some parameters are far away from their starting points, different weights are set for different layers, and a consistent learning rate is used in the iterative process; when L h When is less than a certain threshold, the dynamic behavior of similar circuits is modeled.