CN116975651A - Similarity determination model processing method, target object searching method and device - Google Patents

Similarity determination model processing method, target object searching method and device Download PDF

Info

Publication number
CN116975651A
CN116975651A CN202310920749.7A CN202310920749A CN116975651A CN 116975651 A CN116975651 A CN 116975651A CN 202310920749 A CN202310920749 A CN 202310920749A CN 116975651 A CN116975651 A CN 116975651A
Authority
CN
China
Prior art keywords
sequence
data
processing
layer
discrete
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310920749.7A
Other languages
Chinese (zh)
Inventor
石志林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202310920749.7A priority Critical patent/CN116975651A/en
Publication of CN116975651A publication Critical patent/CN116975651A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a similarity determination model processing method, a target object searching method and a target object searching device. The method involves artificial intelligence, comprising: and according to the initial similarity, determining the coding layer of the model, performing nonlinear transformation processing and dimension reduction processing on each discrete character sampling sequence sample determined based on the data sequence to be screened to obtain each data characteristic vector after dimension reduction, and based on the decoding layer of the initial similarity, determining the decoding layer of the model, performing data reconstruction processing on each data characteristic vector after dimension reduction to obtain a reconstructed data sequence. And determining a compression loss value according to each discrete character sampling sequence sample and each data feature vector, determining a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence, and obtaining a trained similarity determination model when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition. By adopting the method, the accuracy of similarity searching according to the trained similarity determination model can be improved.

Description

Similarity determination model processing method, target object searching method and device
Technical Field
The present application relates to the field of artificial intelligence, and in particular, to a similarity determination model processing method, a target object searching device, a computer device, a storage medium, and a computer program product.
Background
With the development of artificial intelligence technology and the wide use of various application programs or websites, in the application process, a large number of data sequences associated with the application programs and the like are generally required to be subjected to data sequence analysis, so that when a query or a search request is detected, a target data sequence matched with the query request is timely determined from a data sequence set. The similarity search is used as a core processing means for data sequence analysis, and aims to find out the data sequence which is closest to a given query sequence in the data sequence set according to the distance measurement, and then obtain the target data sequence.
Conventionally, an index mode is generally adopted to improve the speed of searching for similarity of data sequences, namely the data sequences can be summarized and represented, and a data index is constructed, so that quick searching and inquiring can be performed based on the index, and a target data sequence closest to the inquiring sequence can be determined from the index.
However, in the conventional index-based search method, a large number of data sequence sets associated with application programs and the like still have the defects of noisy data and weak correlation due to the wide coverage of the application process and different frequency of data related, and further, the index constructed according to the summarized representation of the low-dimensional data sequence and the correlation degree between the query sequences are still low, so that the query result obtained based on the index is also low in accuracy.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a similarity determination model processing method, a target object searching method, an apparatus, a computer device, a storage medium, and a computer program product that are capable of improving the accuracy of a target object for which a similarity search determination is performed.
In a first aspect, the present application provides a similarity determination model processing method. The method comprises the following steps:
acquiring a sample sequence of each discrete character sample determined based on a data sequence to be screened;
determining a coding layer of a model according to the initial similarity, and performing nonlinear transformation processing and dimension reduction processing on each discrete character sampling sequence sample to obtain feature vectors of each data after dimension reduction;
Based on the decoding layer of the initial similarity determination model, carrying out data reconstruction processing on each data feature vector after dimension reduction to obtain a reconstructed data sequence;
in the training process, determining a compression loss value according to each discrete character sampling sequence sample and each data feature vector after dimension reduction, determining a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence, and obtaining a trained similarity determination model when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition.
In a second aspect, the present application provides a target object searching method. The method comprises the following steps:
if a target object search request is detected, acquiring search information corresponding to the target object search request;
acquiring a candidate data sequence set;
performing depth discretization processing on each candidate data sequence in the candidate data sequence set according to the trained similarity determination model to obtain a depth discretized data sequence, performing similarity search based on the depth discretized data sequence, and determining a target object matched with the search information;
The trained similarity determination model is obtained when the calculated fusion loss value meets the model training ending condition in the training process of the initial similarity determination model according to each discrete character sampling sequence sample; the fusion loss value is obtained by determining a compression loss value according to each discrete character sampling sequence sample and each data characteristic vector after dimension reduction and a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence; the data feature vectors after dimension reduction are obtained by performing nonlinear transformation processing and dimension reduction processing on the discrete character sampling sequence samples according to an encoding layer of an initial similarity determination model, and the reconstructed data sequence is obtained by performing data reconstruction processing on the data feature vectors after dimension reduction based on a decoding layer of the initial similarity determination model.
In one embodiment, performing a similarity search based on the depth discretized data sequence, determining a target object that matches the search information includes:
constructing a data sequence discretization index according to each depth discretization data sequence;
And carrying out similarity search based on the data sequence discretization index, and determining a target object matched with the search information.
In a third aspect, the present application further provides a similarity determination model processing device. The device comprises:
the discrete character sampling sequence sample acquisition module is used for acquiring each discrete character sampling sequence sample determined based on the data sequence to be screened;
the dimension reduction processing module is used for determining a coding layer of the model according to the initial similarity, performing nonlinear transformation processing and dimension reduction processing on each discrete character sampling sequence sample, and obtaining each data feature vector after dimension reduction;
the data reconstruction processing module is used for determining a decoding layer of the model based on the initial similarity, and carrying out data reconstruction processing on each data feature vector after dimension reduction to obtain a reconstructed data sequence;
the similarity determination model obtaining module is used for determining a compression loss value according to each discrete character sampling sequence sample and each data feature vector after dimension reduction in the training process, determining a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence, and obtaining a trained similarity determination model when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition.
In a fourth aspect, the application further provides a target object searching device. The device comprises:
the search information acquisition module is used for acquiring search information corresponding to a target object search request if the target object search request is detected;
the candidate data sequence set acquisition module is used for acquiring a candidate data sequence set;
the target object determining module is used for carrying out depth discretization processing on each candidate data sequence in the candidate data sequence set according to the trained similarity determining model to obtain a depth discretization data sequence, carrying out similarity searching based on the depth discretization data sequence and determining a target object matched with the searching information; the trained similarity determination model is obtained when the calculated fusion loss value meets the model training ending condition in the training process of the initial similarity determination model according to each discrete character sampling sequence sample; the fusion loss value is obtained by determining a compression loss value according to each discrete character sampling sequence sample and each data characteristic vector after dimension reduction and a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence; the data feature vectors after dimension reduction are obtained by performing nonlinear transformation processing and dimension reduction processing on the discrete character sampling sequence samples according to an encoding layer of an initial similarity determination model, and the reconstructed data sequence is obtained by performing data reconstruction processing on the data feature vectors after dimension reduction based on a decoding layer of the initial similarity determination model.
In a fifth aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the method of the first aspect or its implementations when the processor executes the computer program.
In a sixth aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the method of the second aspect or implementations thereof as described above when the computer program is executed.
In a seventh aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of the first aspect or implementations thereof described above.
In an eighth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor implements the method of the second aspect or implementations thereof described above.
In a ninth aspect, the present application also provides a computer program product. The computer program product comprising a computer program which, when executed by a processor, implements the method of the first aspect or implementations thereof described above.
In a tenth aspect, the present application also provides a computer program product. The computer program product comprising a computer program which, when executed by a processor, implements the method of the second aspect described above or in various implementations thereof.
In the above model processing method, the target object searching method, the device, the computer equipment, the storage medium and the computer program product for determining the similarity, the model summarizing and learning of the discrete sample sequence with low dimensionality can be realized by acquiring the discrete character sampling sequence samples determined based on the data sequence to be screened, determining the coding layer of the model according to the initial similarity, performing nonlinear transformation processing and dimension reduction processing on the discrete character sampling sequence samples to obtain the dimension reduced data feature vectors, and thus, the model can learn the information in the discrete character sampling sequence samples better in the training process. Further, based on a decoding layer of the initial similarity determination model, carrying out data reconstruction processing on each data feature vector after dimension reduction to obtain a reconstructed data sequence, determining a compression loss value according to each discrete character sampling sequence sample and each data feature vector after dimension reduction in the training process, determining a reconstruction loss value according to the discrete character sampling sequence sample and the reconstructed data sequence, obtaining a trained similarity determination model when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition, and reducing error data in the model training process and improving the trained model precision by comprehensively considering training losses among different components, sampling sequence samples, intermediate results, reconstructed data sequences and the like in the model training process so as to improve the accuracy of a target object matched with search information when the subsequent similarity determination model searches for the candidate data sequence set based on the trained similarity.
Drawings
FIG. 1 is an application environment diagram of a similarity determination model processing method and a target object searching method in one embodiment;
FIG. 2 is a flow chart of a similarity determination model processing method in one embodiment;
FIG. 3 is a flow diagram of obtaining sequence data features corresponding to each discrete character sample sequence sample in one embodiment;
FIG. 4 is a schematic diagram of a residual block in one embodiment;
FIG. 5 is a flow chart of obtaining feature vectors of data after dimension reduction in one embodiment;
FIG. 6 is a flow diagram of obtaining a reconstructed data sequence in one embodiment;
FIG. 7 is a flow chart of determining a compression loss value in one embodiment;
FIG. 8 is a flow diagram of determining a reconstruction loss value in one embodiment;
FIG. 9 is a flow diagram of obtaining samples of a sample sequence of discrete character samples determined based on a sequence of data to be screened in one embodiment;
FIG. 10 is a schematic diagram of reordering discrete characters in a sequence of discrete characters in one embodiment;
FIG. 11 is a flowchart of another exemplary method for processing a similarity determination model;
FIG. 12 is a schematic diagram of a model architecture of a similarity determination model in one embodiment;
FIG. 13 is a flow diagram of a method of searching for a target object in one embodiment;
FIG. 14 is a flow diagram of obtaining a depth discretized data sequence in one embodiment;
FIG. 15 is a complete flow diagram of a target object search in one embodiment;
FIG. 16 is a block diagram showing a structure of a similarity determination model processing apparatus in one embodiment;
FIG. 17 is a block diagram of a target object search device in one embodiment;
fig. 18 is an internal structural view of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The similarity determination model processing method and the target object searching method provided by the embodiment of the application relate to an artificial intelligence technology, and can be applied to various scenes such as cloud technology, artificial intelligence, intelligent traffic, network media, auxiliary driving and the like. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision. The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
Among them, natural language processing (Nature Language processing, NLP) is an important direction in the field of computer science and artificial intelligence, and it is studied on various theories and methods that enable effective communication between a person and a computer in natural language. The natural language processing relates to natural language, namely the language used by people in daily life, is closely researched with linguistics, and simultaneously relates to computer science, mathematics and the like. Important techniques for artificial intelligence domain model training include pre-training models developed from large language models (Large Language Model) of the NLP domain. Through fine tuning, the large language model can be widely applied to downstream tasks. Natural language processing techniques typically include text processing, semantic understanding, machine translation, robotic questions and answers, knowledge graph techniques, and the like. Machine Learning (ML) is a multi-domain interdisciplinary, and involves multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory, and it is specially studied how a computer simulates or implements Learning behaviors of a human being to obtain new knowledge or skills, and reorganizes the existing knowledge structure to continuously improve its own performance. Among them, machine learning is the core of artificial intelligence, which is the fundamental approach for making computers intelligent, and is applied throughout various fields of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, confidence networks, reinforcement learning, transfer learning, induction learning, and teaching learning. The pre-training model is the latest development result of deep learning, and the technology is fused.
With research and advancement of artificial intelligence technology, research and application of artificial intelligence technology is developed in various fields, such as common smart home, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned, automatic driving, unmanned aerial vehicle, digital twin, virtual human, robot, artificial intelligence generation content, conversational interaction, smart medical treatment, smart customer service, game AI, etc., and it is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
The similarity determination model processing method and the target object searching method provided by the embodiment of the application relate to the technology of natural language processing, machine learning and the like in the artificial intelligence technology, and can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, portable wearable devices, aircrafts, etc., and the internet of things devices may be smart speakers, smart car devices, etc. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be an independent physical server, or may be a server cluster formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms, where the terminal 102 and the server 104 may be directly or indirectly connected through wired or wireless communication modes, which is not limited in the embodiment of the present application.
The terminal 102 and the server 104 may be separately configured to execute the similarity determination model processing method and the target object searching method provided in the embodiments of the present application, and the terminal 102 and the server 104 may cooperatively execute the similarity determination model processing method and the target object searching method provided in the embodiments of the present application. For example, taking the terminal 102 and the server 104 cooperatively execute the similarity determination model processing method provided by the embodiment of the present application as an example, the server 104 obtains the encoding layer of the model based on the data sequence to be screened by obtaining each discrete character sampling sequence sample determined based on the data sequence to be screened, performs nonlinear transformation processing and dimension reduction processing on each discrete character sampling sequence sample to obtain each data feature vector after dimension reduction, and performs data reconstruction processing on each data feature vector after dimension reduction based on the decoding layer of the model based on the initial similarity determination to obtain the reconstructed data sequence. The data sequence to be screened, the samples of each discrete character sampling sequence, and the like can be stored in a cloud storage of the server 104, or in a data storage system, or in a local storage of the terminal 102, and can be acquired from the server 104, or the data storage system, or the terminal 102 when the similarity determination model processing is required.
Further, the server 104 determines a compression loss value according to each discrete character sampling sequence sample and each data feature vector after dimension reduction in the training process, and determines a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence, so as to obtain a trained similarity determination model when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition. The trained similarity determination model is used for performing similarity search according to a target object search request triggered by the terminal 102, so as to obtain a target object matched with the target object search request.
Similarly, taking the terminal 102 and the server 104 cooperatively execute the target object searching method provided in the embodiment of the present application as an example, if the server 104 detects the target object searching request triggered by the terminal 102, the server obtains the searching information corresponding to the target object searching request. Further, the server 104 performs depth discretization processing on each candidate data sequence in the candidate data sequence set by acquiring the candidate data sequence set and determining a model according to the trained similarity, so as to obtain a depth discretized data sequence, so as to perform similarity search based on the depth discretized data sequence, and determine a target object matched with the search information. After obtaining the target object matched with the search information, the target object is fed back to the terminal 102 triggering the target object search request. The search information, the candidate data sequence set, the depth discretized data sequence, and the like may be stored in a cloud storage of the server 104, or in a data storage system, or in a local storage of the terminal 102, and may be acquired from the server 104, or the data storage system, or the terminal 102 when the target object search process is required.
In one embodiment, as shown in fig. 2, a similarity determination model processing method is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
step S202, each discrete character sampling sequence sample determined based on the data sequence to be screened is obtained.
Wherein the data sequence to be screened represents an unprocessed raw data sequence for sampling a model training sample, and the discrete character sample sequence samples represent training samples for training an initial similarity determination model.
Specifically, discretizing the data sequence to be screened to map the data sequence to be screened into a discrete character sequence composed of discrete characters, and sampling based on the discrete character sequence to obtain each discrete character sampling sequence sample.
Wherein, the data sequence S= { p to be screened 1 ,…,p m "is a sequence of data points, each point p i =(v i ,t i ) I is more than or equal to 1 and less than or equal to m, and each point is combined with a real number v i And position t i Associated, the position corresponds to the order of the values in the sequence, m is the length of the data sequence, andrepresenting the set of data sequences to be screened, i.e. +.>Wherein n is the set of data sequences to be screened +. >Specifically, sampling is performed based on each data sequence to be screened in the data sequence set to be screened, so that the data sequence set to be screened can be sampled to obtain the data sequence set +.>Corresponding discrete charactersSampling the sequence samples.
In one embodiment, for example, the data sequence to be screened (i.e. the raw data sequence without processing) is {1,2,3,4}, and the discrete character sequences { a, b } formed by the discrete characters are obtained by segmenting the data sequence to be screened {1,2,3,4}, and then discretizing, for example, by dividing the data sequence into two segments, and then discretizing each segment to obtain two discrete characters { a }, { b }, respectively. The length of the data sequence to be screened is not specifically limited, the data sequence to be screened can be set according to actual requirements, the representation form of the discrete characters is not specifically limited, and the data sequence to be screened can be expressed by letters or expressed by a two-level system (namely 0 and 1).
Further, before sampling based on the discrete character sequence, it is necessary to reorder each discrete character according to the character importance bit of each discrete character in the discrete character sequence, so as to obtain a reordered character sequence, that is, specifically, sample the reordered character sequence, so as to obtain a sample of each discrete character sampling sequence. Wherein, the character importance bit of the discrete character can be determined according to the position of each discrete character in the discrete character sequence, namely, the higher the character importance bit level of the discrete character positioned earlier in the discrete character sequence.
In one embodiment, taking {4,5,1,3} as an example of the data sequence to be screened, discretizing the data sequence, and mapping to obtain discrete characters of {100}, {101}, {001}, {011}, and further obtaining a discrete character sequence of {100,101,001,011}, and determining character importance bits of different levels according to the position of each discrete character in the discrete character sequence. In this embodiment, according to the representation of the discrete characters in the discrete character sequence, the determined character importance bits include a first character importance bit, a second character importance bit and a third character importance bit.
Specifically, the first character significant bit of {100} is the first "1", the first character significant bit of {101} is the first "1", the first character significant bit of {001} is the first "0", and the first character significant bit of {011} is the first "0", so that the discrete character sequence corresponding to the first character significant bit is {1100}.
Similarly, the second character significant bit of {100} is middle "0", {101} is middle "0", {001} is middle "0", {011} is middle "1", and thus the discrete character sequence corresponding to the second character significant bit is {0001}.
And the third character significant bit of {100} is the last "0", {101} is the last "1", {001} is the last "1", {011} is the last "1", and the discrete character sequence corresponding to the third character significant bit is {0111}.
Further, by sequentially sorting the discrete character sequence corresponding to the first character significant bit into {1100}, the discrete character sequence corresponding to the second character significant bit into {0001}, and the discrete character sequence corresponding to the third character significant bit into {0111}, according to the level of the character significant bit (i.e., sorting the first character significant bit to the third character significant bit), a discrete character sequence of {110,000,010,111}, and more specifically, a rearranged character sequence of {110,000,010,111} is sampled, so as to obtain each discrete character sample sequence sample.
By reordering the discrete characters, all important bits appear before all unimportant bits, so that a value array with importance degrees arranged in a descending order is presented, distribution information of a data set can be saved, and sampling efficiency of subsequent similarity search based on the data sequence is improved.
And step S204, carrying out nonlinear transformation processing and dimension reduction processing on each discrete character sampling sequence sample according to the coding layer of the initial similarity determination model to obtain each data feature vector after dimension reduction.
The coding layer of the initial similarity determination model comprises a nonlinear transformation layer and a dimension reduction processing layer, wherein the nonlinear transformation layer is used for carrying out nonlinear transformation processing on each discrete character sampling sequence sample to obtain sequence data characteristics, and the dimension reduction processing layer is used for carrying out dimension reduction processing on the sequence data characteristics subjected to the nonlinear transformation processing to obtain data characteristic vectors subjected to dimension reduction.
Specifically, nonlinear transformation processing is carried out on each discrete character sampling sequence sample according to the nonlinear transformation layer, sequence data characteristics corresponding to each discrete character sampling sequence sample are obtained, and based on the dimension reduction processing layer, dimension reduction processing is carried out on each sequence data characteristic according to a sequence square sum invariant processing logic, so that each data characteristic vector after dimension reduction is obtained.
In one embodiment, the nonlinear transformation layer may specifically include a convolution layer, a multi-layer residual block, a normalization layer, a nonlinear activation layer, and a pooling layer. According to the convolution layer in the nonlinear transformation layer, feature coding processing and data feature extraction can be performed on each discrete character sampling sequence sample, so that initial data features corresponding to each discrete character sampling sequence sample are obtained.
While a multi-layer residual block may be understood as a superposition of multiple residual blocks (e.g., a superposition of K-layer residual blocks), with each residual block in the multi-layer residual block, a residual mapping process may be performed on the initial data characteristics to obtain residual mapped data. And the residual mapping data obtained by carrying out residual mapping processing is used for being overlapped with the initial data characteristics of the input residual block so as to obtain intermediate data characteristics.
Further, the normalization layer, the nonlinear activation layer and the pooling layer are used for performing normalization processing, nonlinear fitting processing and pooling processing on the intermediate data features, so that the sequence data features are obtained.
In one embodiment, the dimension reduction processing layer specifically includes a plurality of full connection layers, a nonlinear activation layer and a target normalization layer, performs dimension reduction processing on data features of each sequence according to a sequence square sum invariant processing logic based on the dimension reduction processing layer, and obtains feature vectors of each data after dimension reduction, including:
through the full connection layer and the nonlinear activation layer, vector conversion processing and nonlinear activation processing are carried out on the sequence data characteristics to obtain sequence characteristic vectors; and performing dimension reduction processing on each sequence feature vector according to the sequence square sum invariant processing logic based on the target normalization layer to obtain each data feature vector after dimension reduction.
The full connection layer is used for carrying out vector conversion processing on the sequence data features, and the full connection layer is used for mapping the learned sequence data feature representation into a sample mark space to realize linear transformation from one feature space to another feature space, namely, the full connection layer is used for converting the sequence data features into corresponding feature vectors in a matrix vector product mode. And the nonlinear activation layer is used for carrying out nonlinear activation processing on the feature vector obtained based on the feature conversion of the sequence data, so as to obtain the sequence feature vector.
Further, by obtaining a preset square sum matrix set for the sequence square sum invariant processing logic and calculating the peace square corresponding to the sequence feature vector according to the preset square sum matrix, the dimension reduction processing is performed on each sequence feature vector by using the target normalization layer according to the sequence square sum invariant processing logic, namely, the dimension reduction processing is performed on each sequence feature vector, and meanwhile, the square sum of each sequence feature vector is maintained unchanged, so that each data feature vector after dimension reduction is obtained.
Step S206, based on the decoding layer of the initial similarity determination model, performing data reconstruction processing on the feature vectors of the data after the dimension reduction to obtain a reconstructed data sequence.
Wherein the decoding layer of the initial similarity determination model comprises: multi-layer full-link layer, multi-layer nonlinear active layer, convolutional layer, multi-layer residual block (such as K-layer residual block, each of which includes a stacked structure of multiple normalization layers, nonlinear active layers, and convolutional layers), normalization layers, and pooling layers, etc.
Specifically, a full connection layer and a nonlinear activation layer in a decoding layer are utilized to perform vector conversion processing and nonlinear activation processing on the data feature vector after dimension reduction to obtain a reconstructed data sequence feature vector, and a convolution layer is utilized to perform feature extraction processing on the reconstructed data sequence feature vector to obtain initial reconstructed data sequence features corresponding to the reconstructed data sequence feature vector.
And performing residual mapping processing and data feature superposition processing on the initial reconstructed data sequence features by using each residual block in the multi-layer residual blocks to obtain intermediate reconstructed data features, and performing normalization processing, nonlinear fitting processing and pooling processing on the intermediate reconstructed data features by using a normalization layer, a nonlinear activation layer and a pooling layer to obtain the reconstructed data sequence features.
Further, the reconstructed data sequence features are subjected to further multi-layer linear processing and normalization processing by utilizing the multi-layer full-connection layer, the nonlinear activation layer and the normalization layer so as to obtain a reconstructed data sequence.
Step S208, in the training process, a compression loss value is determined according to each discrete character sampling sequence sample and each data feature vector after dimension reduction, a reconstruction loss value is determined according to the discrete character sampling sequence sample and the reconstruction data sequence, and a trained similarity determination model is obtained when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition.
The compression loss value corresponds to the difference between the first pairing distance between the discrete character sampling sequence samples and the second pairing distance between the data feature vectors after the dimension reduction, namely, whether the first pairing distance between the discrete character sampling sequence samples is reserved in a low-dimensional space constructed by the data feature vectors after the dimension reduction can be estimated through the compression loss value. And the reconstruction loss value corresponds to the average distance between the discrete character sampling sequence sample and each reconstruction data vector in the reconstruction data sequence, and is used for evaluating the quality of reconstruction of the discrete character sampling sequence sample (i.e. the quality of the obtained reconstruction data sequence).
Specifically, a compression loss value is determined according to a first pairing distance between the discrete character sampling sequence samples and a second pairing distance between the data feature vectors after dimension reduction, and a reconstruction loss value is determined according to a third pairing distance between the discrete character sampling sequence samples and the reconstruction data vectors in the reconstruction data sequence.
Further, according to the compression loss value and the reconstruction loss value, determining a fusion loss value, determining that model training is finished when the fusion loss value is determined to meet the model training finishing condition, and determining an initial similarity determination model at the end of training as a trained similarity determination model.
In one embodiment, when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition, obtaining a trained similarity determination model includes:
weighting the reconstruction loss according to the weight parameter corresponding to the reconstruction loss value to obtain a weighted reconstruction loss value; summing processing is carried out on the basis of the compression loss value and the weighted reconstruction loss value, so that a fusion loss value is obtained; if the fusion loss value reaches the preset loss threshold value corresponding to the model training ending condition, determining that the model training is ended, and determining the initial similarity determination model after the training is ended as a trained similarity determination model.
Specifically, the reconstruction loss is weighted according to the weight parameter by acquiring the weight parameter corresponding to the reconstruction loss, the weighted reconstruction loss is obtained, and the compression loss and the weighted reentrant loss are summed to obtain the fusion loss. The weight parameter may be understood as a super parameter for balancing the compression loss value and the reconstruction loss value, and may be set and adjusted according to an actual application scenario, where the value is not specifically limited.
Further, by acquiring a preset loss threshold corresponding to the model training ending condition and comparing the fusion loss value with the preset loss threshold, if the fusion loss value is determined to reach the preset loss threshold, the condition that the model training ending condition is met is indicated, and the model training ending is determined. Conversely, if the fusion loss value does not reach the preset loss threshold, it indicates that the model training ending condition is not met at present, and the iterative training needs to be continued on the initial similarity determination model until the fusion loss value reaches the preset loss threshold, that is, the model training is ended, so as to obtain a trained similarity determination model.
In one embodiment, the model training end condition may also be that the number of training iterations of the initial similarity determination model reaches a preset number of times threshold, that is, when the number of training iterations of the initial similarity determination model reaches the preset number of times threshold, it indicates that the current model loss value (that is, the fusion loss value has reached the preset loss threshold) also reaches the training end condition, so as to obtain the trained similarity determination model.
In the similarity determination model processing method, the discrete character sampling sequence samples determined based on the data sequences to be screened are obtained, the coding layer of the model is determined according to the initial similarity, nonlinear transformation processing and dimension reduction processing are carried out on the discrete character sampling sequence samples, and the dimension-reduced data feature vectors are obtained, so that the model can learn information in the discrete character sampling sequence samples better in the training process, and the summarization learning of the discrete sample sequences with low dimension is realized. Further, based on a decoding layer of the initial similarity determination model, carrying out data reconstruction processing on each data feature vector after dimension reduction to obtain a reconstructed data sequence, determining a compression loss value according to each discrete character sampling sequence sample and each data feature vector after dimension reduction in the training process, determining a reconstruction loss value according to the discrete character sampling sequence sample and the reconstructed data sequence, obtaining a trained similarity determination model when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition, and reducing error data in the model training process and improving the trained model precision by comprehensively considering training losses among different components, sampling sequence samples, intermediate results, reconstructed data sequences and the like in the model training process so as to improve the accuracy of a target object matched with search information when the subsequent similarity determination model searches for the candidate data sequence set based on the trained similarity.
In one embodiment, as shown in fig. 3, the step of obtaining the sequence data features corresponding to each discrete character sampling sequence sample, that is, performing nonlinear transformation processing on each discrete character sampling sequence sample according to a nonlinear transformation layer, and obtaining the sequence data features corresponding to each discrete character sampling sequence sample specifically includes:
step S302, performing feature encoding processing on each discrete character sampling sequence sample to obtain initial data features.
The coding layer of the initial similarity determination model comprises a nonlinear transformation layer, the nonlinear transformation layer is used for carrying out nonlinear transformation processing on each discrete character sampling sequence sample to obtain sequence data characteristics, and the nonlinear transformation layer specifically comprises a convolution layer, a multi-layer residual block, a normalization layer, a nonlinear activation layer and a pooling layer.
Specifically, according to the convolution layer in the nonlinear transformation layer, feature encoding processing and data feature extraction can be performed on each discrete character sampling sequence sample, so as to obtain initial data features corresponding to each discrete character sampling sequence sample.
Step S304, carrying out residual mapping processing on the initial data features according to each residual block in the multi-layer residual blocks to obtain residual mapping data, and superposing the residual mapping data and the initial data features to obtain intermediate data features.
The multi-layer residual block may be understood as a superposition structure of multiple residual blocks (such as a superposition structure of K-layer residual blocks), where each residual block in the multi-layer residual block includes a superposition structure of multiple normalized layers, nonlinear active layers, and convolution layers.
Specifically, with each of the multi-layer residual blocks, a residual mapping process may be performed on the initial data characteristics to obtain residual mapped data. Further, residual mapping data obtained by performing residual mapping processing is used for being overlapped with the initial data characteristics of the input residual block so as to obtain intermediate data characteristics.
In one embodiment, as shown in fig. 4, a composition structure of residual blocks is provided, and referring to fig. 4, each residual block includes a superposition structure of a plurality of normalization layers (i.e., layerNorm layers in fig. 4), nonlinear activation layers (i.e., RELU function nonlinear activation layers in fig. 4), and convolution layers (i.e., convLayer layers in fig. 4). The RELU function nonlinear activation layer means that the layer specifically performs nonlinear activation processing on the feature vector by using the RELU activation function.
Specifically, the number of the structures of the "normalization layer+nonlinear activation layer+full connection layer" included in each residual block may be set and adjusted according to actual needs, and in the residual block shown in fig. 4, the structures of the "normalization layer+nonlinear activation layer+full connection layer" including 2 are superimposed, and residual mapping processing is performed on the initial data features through the structures of the "normalization layer+nonlinear activation layer+full connection layer" including 2, so as to obtain residual mapping data.
Further, after the up-sampling process and the down-sampling process are performed on the initial data feature, the up-sampled/down-sampled initial feature data and residual mapping data are overlapped to obtain an intermediate data feature, and the intermediate data feature is used as an output result of the multi-layer residual block.
The expansion of the multi-layer residual block in the nonlinear transformation layer increases exponentially with the layer depth, i.e. the number of layers of the residual block increases, for example, from 2 layers to K layers, and the number of overlapping structures of a normalization layer, a nonlinear activation layer and a full connection layer contained in the residual block increases exponentially with the overlapping of one layer, so that compared with the constant expansion, the overlapping structure of the multi-layer residual block for the data sequence application program can effectively expand the receptive field, thereby obtaining more comprehensive and wide data characteristics. Where the Receptive Field (i.e., receptive Field) refers to the area of the input image that is visible at a point on the feature map, i.e., the point on the feature map is calculated from the Receptive Field size area in the input image, a larger value for the neuronal Receptive Field indicates a larger range of the original image that it can touch, which means that it may contain more global, higher semantic level features.
And step S306, performing normalization processing, nonlinear fitting processing and pooling processing on the intermediate data characteristics to obtain sequence data characteristics.
Specifically, the intermediate data feature is subjected to normalization processing, nonlinear fitting processing and pooling processing according to a normalization layer (such as a layerrnorm layer), a nonlinear activation layer (such as a RELU function nonlinear activation layer) and a pooling layer (such as a Maxpool layer, i.e., a maximum pooling layer), so as to obtain a sequence data feature.
The dimension of each data feature vector (i.e., the output vector of the coding layer, also referred to as the hidden vector) after the dimension reduction, the number of channels of the coding layer, and the dimension of the input sequence (i.e., the discrete character sampling sequence sample of the input coding layer) are the same, so that the nonlinear transformation processing performed on each discrete character sampling sequence sample in the channels of the coding layer can be understood as equal-length nonlinear transformation, that is, the dimension of the data sequence or the feature vector is not changed when the nonlinear transformation processing is performed.
In this embodiment, the initial data feature is obtained by performing feature encoding processing on each discrete character sampling sequence sample, residual mapping processing is performed on the initial data feature according to each residual block in the multi-layer residual block, residual mapping data is obtained, the residual mapping data and the initial data feature are overlapped to obtain intermediate data feature, and the sequence data feature is obtained by performing normalization processing, nonlinear fitting processing and pooling processing on the intermediate data feature, so that when the residual mapping processing is performed according to the multi-layer residual block overlapping structure, the receptive field of the data feature is expanded, thereby obtaining more comprehensive and wide data feature, avoiding the situation of missing the data feature, reducing error data in the model training process, and improving the model training precision.
In one embodiment, as shown in fig. 5, the step of obtaining the feature vectors of each data after the dimension reduction, that is, based on the target normalization layer, performs dimension reduction processing on each sequence feature vector according to the sequence square sum invariant processing logic, so as to obtain each feature vector of each data after the dimension reduction, which specifically includes:
step S502, a preset square sum matrix corresponding to the sequence square sum invariant processing logic is obtained.
The sequence square sum invariable processing logic can be understood as logic for maintaining the square sum of each sequence feature vector invariable in the process of performing the dimension reduction processing on each sequence feature vector. The square sum is maintained unchanged in the dimension reduction process, and the square sum can be regarded as a quality index of data conversion in the dimension reduction process, namely, the quality of a discrete character sampling sequence sample obtained by discretizing a data sequence to be screened can be maintained by keeping the square sum unchanged, so that a model is focused on data characteristics, information and the like obtained after nonlinear transformation processing in the model training process.
Specifically, for the sequence square sum invariant processing logic, a corresponding preset square sum matrix is preset, that is, a matrix M of n×m is given for the sequence feature vector, and each row M in the matrix i,* Corresponding to a feature vector, each column M *,j The sum of squares is defined corresponding to the position (or order) of a feature vector in the sequenceThat is, when calculating the sum of squares S, it is necessary to determine the data M corresponding to each of the sequence feature vectors based on a preset sum of squares matrix i,* Sum column data M *,j
Step S504, determining row data and column data corresponding to each sequence of feature vectors based on a preset sum-of-squares matrix.
Specifically, the sequence feature vector includes a plurality of feature vectors, and a matrix M of n×m is given for the sequence feature vector, where each row M in the matrix i,* Corresponding to a feature vector, each column M in the matrix *,j Corresponding to the position (or order) of a feature vector in the sequence, the sum of squaresThat is, when calculating the sum of squares, it is necessary to determine the data M corresponding to each of the sequence feature vectors based on a preset sum of squares matrix i,* Sum column data M *,j
Step S506, determining the square sum corresponding to each sequence feature vector according to the row data and the column data corresponding to each sequence feature vector.
Specifically, the sequence feature vector includes a plurality of feature vectors, each corresponding to a respective row data M i,* Sum column data M *,j Specifically, based on each feature vector Data M of (2) i,* Sum column data M *,j Calculating the square sum corresponding to the feature vectorAnd by corresponding sum of squares for each feature vector +.>And summing to obtain the square sum S of the corresponding sequence feature vectors.
Step S508, carrying out standardization processing on each sequence feature vector based on the target normalization layer, and carrying out sequence scaling and dimension reduction processing on the standardized sequence feature vector according to a sequence square sum invariant processing logic to obtain each data feature vector after dimension reduction.
Specifically, based on the target normalization layer, the normalization processing is performed on each sequence feature vector, which may be a zero-mean normalization manner, where the normalization of each sequence feature vector is performed to obtain a mean value of 0 and standard deviation is 1, so as to achieve the purpose of keeping the first pairing distance between the samples of each discrete character sampling sequence unchanged, and simultaneously improving the quality of the depth discretization data sequence obtained after the depth embedding discretization processing by using the similarity determination model.
Further, the dimension reduction processing is performed based on the normalized sequence feature vector, and meanwhile, according to the square sum of sequence invariant processing logic, that is, the square sum of the sequence feature vector needs to be kept unchanged, the normalized sequence feature vector needs to be subjected to sequence scaling, so that each data feature vector with unchanged square sum and dimension reduction can be obtained.
In one embodiment, the sequence scaling is performed on the normalized sequence feature vector, which may be specifically embodied in calculating the fusion loss value, performing a sequence scaling process on a first pairing distance between the discrete character sampling sequence samples by using the sample number of the discrete character sampling sequence samples, and performing a sequence scaling process on a second pairing distance between the data feature vectors by using the vector number of the data feature vectors after the dimension reduction.
When the sequence scaling is performed on the first pairing distance between the discrete character sampling sequence samples, specifically, the scaling is achieved by calculating a first square root corresponding to the number of the discrete character sampling sequence samples and dividing the first pairing distance by the first square root.
Similarly, when performing a sequence scaling process on the second pairing distance between the data feature vectors by using the vector number of each data feature vector after the dimension reduction, specifically, the scaling purpose is achieved by calculating a second square root corresponding to the vector number of each data feature vector after the dimension reduction and processing the second pairing distance into the second square root.
The first pairing distance and the second pairing distance between the data feature vectors can be kept at the same level by utilizing the sample number of the discrete character sampling sequence samples to conduct sequence scaling processing on the first pairing distance between the discrete character sampling sequence samples and utilizing the vector number of the data feature vectors after dimension reduction to conduct sequence scaling processing on the second pairing distance between the data feature vectors, so that the first pairing distance between the discrete character sampling sequence samples can be well reserved in a low-dimension space constructed by the data feature vectors after dimension reduction, and errors caused in nonlinear transformation processing and dimension reduction processing are reduced.
In this embodiment, the row data and the column data corresponding to each sequence feature vector are determined by acquiring a preset sum-of-squares matrix corresponding to the sequence sum-of-squares invariant processing logic, and based on the preset sum-of-squares matrix. Further, according to row data and column data corresponding to each sequence feature vector, determining a square sum corresponding to each sequence feature vector, carrying out standardization processing on each sequence feature vector based on a target normalization layer, carrying out sequence scaling and dimension reduction processing on the standardized sequence feature vector according to a sequence square sum invariant processing logic so as to obtain each data feature vector after dimension reduction, maintaining the square sum unchanged in the dimension reduction process, and maintaining the quality of discrete character sampling sequence samples obtained by discretizing a data sequence to be screened, so that a model is focused on learning data features and information obtained after nonlinear transformation processing in the model training process, and model training accuracy is improved.
In one embodiment, as shown in fig. 6, the step of obtaining the reconstructed data sequence, that is, based on the decoding layer of the initial similarity determination model, performs data reconstruction processing on each data feature vector after the dimension reduction, and specifically includes the steps of:
step S602, based on the decoding layer of the initial similarity determination model, vector conversion processing and nonlinear transformation processing are carried out on the data feature vectors after the dimension reduction, and the reconstructed data sequence feature vectors are obtained.
The decoding layer of the initial similarity determination model specifically comprises: multi-layer full-link layer, multi-layer nonlinear active layer, convolutional layer, multi-layer residual block (such as K-layer residual block, each of which includes a stacked structure of multiple normalization layers, nonlinear active layers, and convolutional layers), normalization layers, and pooling layers, etc.
Specifically, a full connection layer and a nonlinear activation layer in a decoding layer are utilized to perform vector conversion processing and nonlinear activation processing on the data feature vector after dimension reduction to obtain a reconstructed data sequence feature vector, and a convolution layer is utilized to perform feature extraction processing on the reconstructed data sequence feature vector to obtain initial reconstructed data sequence features corresponding to the reconstructed data sequence feature vector.
The nonlinear activation layer performing nonlinear activation processing on the data feature vector after the dimension reduction may be specifically a Tanh function nonlinear activation layer (i.e., by introducing a nonlinear function Tanh function as an excitation function, the data feature vector is subjected to nonlinear activation processing, so that the model is no longer a linear combination of inputs, but an arbitrary function can be approximated to increase the nonlinearity of the neural network model), that is, by the nonlinear activation processing, the dimension adjustment may be performed on the data feature vector after the dimension reduction, for example, the dimension of the data feature vector after the dimension reduction is increased, so as to realize reconstruction of a data sequence, and avoid the problem that the dimension of a reconstructed data sequence and a discrete character sampling sequence sample of an input coding layer is different.
Step S604, performing feature encoding processing on the feature vectors of the reconstructed data sequence to obtain the features of the initial reconstructed data sequence.
Specifically, the convolution layer in the decoding layer is utilized to perform feature encoding processing and data feature extraction on the reconstructed data sequence feature vector, so as to obtain the initial reconstructed data sequence feature corresponding to the reconstructed data sequence feature vector.
Step S606, residual mapping processing and data feature superposition processing are carried out based on the initial reconstructed data sequence features, and intermediate reconstructed data features are obtained.
Specifically, residual mapping processing and data feature superposition processing are performed on the initial reconstructed data sequence features by using multi-layer residual blocks in the decoding layer. The multi-layer residual block may be understood as a superposition structure of multiple residual blocks (such as a superposition structure of K-layer residual blocks), and specifically, each residual block in the multi-layer residual block is used to perform residual mapping processing and data feature superposition processing on the initial reconstructed data sequence feature, so as to obtain an intermediate reconstructed data feature.
Each residual block includes a superposition structure of multiple normalization layers, nonlinear activation layers and convolution layers, and the number of the structures of the normalization layer, the nonlinear activation layers and the full connection layers included in each residual block can be set and adjusted according to actual requirements, for example, each residual block can include 2 structures of the normalization layer, the nonlinear activation layers and the full connection layers, that is, the residual mapping process is performed on the features of the initial reconstructed data sequence through the structures of the 2 structures of the normalization layer, the nonlinear activation layers and the full connection layers, so as to obtain intermediate residual mapping data. The nonlinear activation layer included in the residual block may be a RELU function nonlinear activation layer, which means that the layer specifically uses a RELU activation function to perform nonlinear activation processing on the feature vector, that is, by adding the nonlinear activation layer, the model is no longer a linear combination of inputs, but may approximate an arbitrary function to increase the nonlinearity of the neural network model.
Further, after the up-sampling processing and the down-sampling processing are performed on the initial data features, the up-sampled/down-sampled initial reconstructed data sequence features and the intermediate residual mapping data are overlapped to obtain intermediate reconstructed data features, and the intermediate reconstructed data features are used as output results of the multi-layer residual block.
The expansion of the multi-layer residual block in decoding increases exponentially with the layer depth, i.e. the number of layers of the residual block increases, for example, from 2 layers to K layers, and the number of superimposed structures of a normalization layer, a nonlinear activation layer and a full connection layer contained in the residual block increases exponentially with the superposition of one layer, so that compared with constant expansion, the superimposed structure of the multi-layer residual block for a data sequence application program can effectively expand the receptive field, thereby obtaining more comprehensive and wide data characteristics.
And step S608, performing normalization processing, nonlinear fitting processing and pooling processing on the intermediate reconstructed data characteristics to obtain reconstructed data sequence characteristics.
Specifically, a normalization layer, a nonlinear activation layer and a pooling layer in the decoding layer are utilized to sequentially perform normalization processing, nonlinear fitting processing and pooling processing on the intermediate reconstructed data characteristics so as to obtain reconstructed data sequence characteristics.
The nonlinear activation layer for performing nonlinear fitting processing on the intermediate reconstructed data features may specifically be a RELU function nonlinear activation layer, that is, the layer specifically performs nonlinear activation processing on the intermediate reconstructed data features by using a RELU activation function.
Step S610, performing multi-layer linear processing and normalization processing based on the characteristics of the reconstructed data sequence to obtain the reconstructed data sequence.
Specifically, the characteristics of the reconstructed data sequence are sequentially subjected to multi-layer linear processing and normalization processing by utilizing a plurality of full-connection layers, a nonlinear activation layer and a normalization layer in the decoding layer, so as to obtain the reconstructed data sequence.
When multi-layer linear processing and normalization processing are carried out on the reconstructed data sequence features, specifically a first full-connection layer, an activation function layer, a second full-connection layer and a normalization layer, feature encoding processing, data feature extraction, nonlinear activation processing, secondary data feature extraction and normalization processing are sequentially carried out on the reconstructed data sequence features, so that a reconstructed data sequence is obtained.
In this embodiment, based on a decoding layer of the initial similarity determination model, vector transformation processing and nonlinear activation processing are performed on the data feature vector after the dimension reduction to obtain a reconstructed data sequence feature vector, and feature encoding processing is performed on the reconstructed data sequence feature vector to obtain an initial reconstructed data sequence feature. Further, residual mapping processing and data feature superposition processing are performed based on the initial reconstructed data sequence features, intermediate reconstructed data features are obtained, normalization processing, nonlinear fitting processing and pooling processing are performed on the intermediate reconstructed data features to obtain reconstructed data sequence features, so that multi-layer linear processing and normalization processing can be performed based on the reconstructed data sequence features to obtain a reconstructed data sequence, a decoding layer of a model is determined by utilizing initial similarity, a series of data reconstruction operations are performed on the data feature vectors after dimension reduction, so that reconstructed data sequences corresponding to discrete character sampling sequence samples of an input coding layer are obtained through reconstruction, and quality of the reconstructed data sequences is effectively maintained through components in the coding layer, so that model training accuracy is improved.
In one embodiment, as shown in fig. 7, the step of determining the compression loss value, that is, determining the compression loss value according to each discrete character sampling sequence sample and each data feature vector after dimension reduction, specifically includes:
step S702, constructing and obtaining an original data sequence pair according to any two discrete character sampling sequence samples, and determining a first pairing distance between the original data sequence pairs.
The compression loss value corresponds to the difference between the first pairing distance between the discrete character sampling sequence samples and the second pairing distance between the data feature vectors after the dimension reduction, namely, whether the first pairing distance between the discrete character sampling sequence samples is reserved in a low-dimensional space constructed by the data feature vectors after the dimension reduction can be estimated through the compression loss value.
Specifically, for a set of data sequences to be screened in the training processEach sequence S of (a) i From the data sequence set to be screened +.>Is selected randomly from a group of different sequences S j To form a pair (S) i ,S j ) I.e. arbitrarily selecting two discrete character sampling sequence samples, constructing to obtain an original data sequence pair, and determining a first pairing distance between the original data sequence pair. Wherein due to S i And S is j Are all from the set of data sequences to be screened +.>To prevent model gradients from being counter-propagated twice during the training process, S is applied j Considered as constant instead of input variable, input variable or argument being S i
Further, for any two discrete character sampling sequence samples, an original data sequence pair is constructed (S i ,S f ) Calculate the original data sequence pair (S i ,S j ) First paired distance d1=d (S i ,S j ). Wherein the first pairing distance may be specifically Euclidean distance (Euclidean distance, representing the true distance between two points in m-dimensional space), i.e. the original data sequence pair is calculated (S i ,S j ) The Euclidean distance between them, the first pairing distance d1 is obtained.
Step S704, randomly constructing discrete data pairs based on the feature vectors of the data after the dimension reduction, and determining a second pairing distance between the discrete data pairs.
Specifically, discrete data pairs are constructed by acquiring each data feature vector after dimension reduction and based on each data feature vector after dimension reduction of any two. When the compression loss value is calculated in the training process, model parameters of a coding layer of a model are required to be obtained, mapping processing is carried out on each discrete character sampling sequence sample according to the model parameters of the coding layer, vectors after coding are obtained through the coding layer, namely, each data characteristic vector after dimension reduction is obtained, and further, a second pairing distance between discrete data pairs randomly constructed by each data characteristic vector after dimension reduction is calculated.
The calculation formula of the coding layer of the model is shown in the following formula (1):
E i =φ(S i ∣Θ φ ) (1)
wherein Θ is φ Refers to the model parameters of the coding layer, and needs to be according to the parameters theta φ Sampling a sequence sample S of discrete characters i The data in (a) is mapped to obtain a vector phi (S) encoded by the encoding layer i ) (i.e. E i ),S i Is a sample of a sample sequence of discrete character samples, E i Is with S i Corresponding data characteristic vector after dimension reduction.
Further, a second pair-wise distance between discrete pairs of data is determined using the following equation (2):
d2=d(φ(S i ),φ(S j )) (2)
wherein d2 is the second pair distance between the discrete data pairs, φ (S i ) Representing the basis of the parameter theta φ Sampling a sequence sample S of discrete characters i The data in (a) is mapped to obtain a feature vector of the reduced data, and similarly, phi (S j ) Representing the basis of the parameter theta φ Sampling a sequence sample S of another discrete character j The data in (a) is mapped, and the obtained feature vector of the data after dimension reduction is phi (S) i ),φ(S j ) Representing discrete data pairs randomly constructed based on the reduced-dimension data feature vectors. Wherein the second pair distance may be specifically Euclidean distance (Euclidean distance, representing the true distance between two points in m-dimensional space), i.e. the discrete data pair φ is calculated (S i ),φ(S j ) The euclidean distance between them, a second pairing distance d2 is obtained.
In step S706, the number of samples of the discrete character sampling sequence samples and the vector number of each data feature vector after the dimension reduction are obtained.
In particularBy acquiring the number of samples of the discrete character sampling sequence samples and determining the original data sequence pair based on the number of samples of the discrete character sampling sequence samples (S i ,S j ) Is a number of (3). The number of samples of the discrete character sampling sequence samples is also used for determining a first scaling factor for performing sequence scaling processing on the first pairing distance.
Similarly, the second scaling factor for performing the sequence scaling processing on the second pairing distance is determined by acquiring the vector quantity of each data feature vector after the dimension reduction and according to the vector quantity of each data feature vector after the dimension reduction.
In step S708, the first pairing distance is subjected to a sequence scaling process according to the number of samples to obtain a first scaling pairing distance, and the second pairing distance is subjected to a sequence scaling process according to the number of vectors to obtain a second scaling pairing distance.
Specifically, according to the number of samples of the discrete character sampling sequence samples, a first scaling coefficient for performing sequence scaling processing on the first pairing distance is determined, and the sequence scaling processing is performed on the first pairing distance according to the first scaling coefficient, so that the first scaling pairing distance is obtained.
In one embodiment, the first scaled pair-wise distance is calculated using the following equation (3):
wherein d1', i.e. the first scaled pair-wise distance, d (S i ,S j ) I.e., the first pairing distance, m, i.e., the number of samples of the discrete character sample sequence samples,i.e. the first scaling factor.
And similarly, determining a second scaling coefficient for performing sequence scaling processing on the second pairing distance according to the vector quantity of each data feature vector after the dimension reduction, and performing sequence scaling processing on the second pairing distance according to the second scaling coefficient to obtain a second scaling pairing distance.
In one embodiment, the second scaled pair-wise distance is calculated using the following equation (4):
where d2', the second scaling pair distance, d (phi (S i ),φ(S j ) I.e., the second pairing distance, n is the vector number of the feature vectors of each data after the dimension reduction,i.e. the second scaling factor. />
It will be appreciated that in calculating the compression loss value, the sample length of the discrete character sample sequence, and the respective data feature vectors after dimension reduction, are divided by the square root of the respective lengths (i.e., based onThe distribution performs a sequence scaling process), and performs a normalization process at the encoding layer using a target normalization layer, scaling is performed by dividing the square root of the respective lengths, and the sum of squares can be preserved (i.e., the sum of squares is maintained) to achieve better dimension reduction while stabilizing the gradient propagation.
In step S710, the number of sequence pairs of the original data sequence pairs is obtained, and a compression loss value is determined according to the number of sequence pairs, each first scaling pair distance, and each second scaling pair distance.
Specifically, by acquiring the number of samples of the discrete character sampling sequence samples and determining the original data sequence pair based on the number of samples of the discrete character sampling sequence samples (S i ,S j ) And calculating a compression loss value according to the number of the sequence pairs, the first scaling pair distance and the second scaling pair distance.
Specifically, the compression loss value L is calculated by the following formula (5) C
Wherein L is C I.e. compression loss value, N p I.e. the original data sequence pair (S i ,S j ) Is used in the number of (a) and (b),representing samples S of a sequence of arbitrary two discrete character samples i ,S j All from the data sequence set to be screened +.>When calculating the compression loss value, the whole data sequence set to be screened needs to be traversed. />Representing a first scaled pair-wise distance,represents a second scaled pair distance, and +.>It is understood that the absolute distance value between the first scaled pair of distances and the second scaled pair of distances is calculated.
In this embodiment, an original data sequence pair is constructed according to any two discrete character sampling sequence samples, a first pairing distance between the original data sequence pairs is determined, discrete data pairs are randomly constructed based on the data feature vectors after dimension reduction, and a second pairing distance between the discrete data pairs is determined. Further, the number of samples of the discrete character sampling sequence samples and the vector number of each data feature vector after dimension reduction are obtained, the first scaling paired distance is obtained by performing sequence scaling processing on the first paired distance according to the number of samples, and the second scaling paired distance is obtained by performing sequence scaling processing on the second paired distance according to the number of vectors, so that a compression loss value is determined according to the number of sequence pairs of the original data sequence pairs, each first scaling paired distance and each second scaling paired distance, and when the compression loss value is calculated in the model training process, the sample number of the discrete character sampling sequence samples and the vector number of each data feature vector after dimension reduction are adopted, the discrete character sampling sequence sample length and each data feature vector after dimension reduction are respectively scaled, so that the sequence square sum can be kept unchanged, better dimension reduction processing is achieved, gradient propagation in the model training process is stabilized, error loss in the model training process is reduced, and model precision is improved.
In one embodiment, as shown in fig. 8, the step of determining a reconstruction loss value, that is, determining a reconstruction loss value according to a discrete character sampling sequence sample and a reconstruction data sequence, specifically includes:
step S802, based on each discrete character sampling sequence sample and the reconstructed data sequence, a reconstructed data sequence pair is randomly constructed.
The reconstruction loss value corresponds to an average distance between the discrete character sampling sequence sample and each reconstruction data vector in the reconstruction data sequence, and is used for evaluating the quality of reconstruction of the discrete character sampling sequence sample (i.e. the quality of the obtained reconstruction data sequence).
Specifically, a discrete character sampling sequence sample is arbitrarily selected, a reconstruction data sequence is arbitrarily selected, and a reconstruction data sequence pair is constructed.
When the reconstruction loss value is calculated in the training process, model parameters of a coding layer of a model are required to be obtained, mapping processing is carried out on each discrete character sampling sequence sample according to the model parameters of the coding layer, and vectors after coding are obtained through the coding layer, namely, each data feature vector after dimension reduction is obtained. Similarly, it is also necessary to obtain model parameters of a decoding layer of the model, and decode and reconstruct each data feature vector after the dimension reduction according to the model parameters of the decoding layer, so as to obtain a reconstructed data sequence.
In one embodiment, the calculation formula of the decoding layer of the model is shown in the following formula (6):
S i ′=ψ(E iψ )=ψ·φ(S iφ,ψ ) (6)
wherein Θ is ψ Refers to model parameters of the decoding layer, which need to be according to the parameters theta ψ For each data characteristic vector E after dimension reduction i Mapping processing is performed to obtain a reconstructed data sequence ψ (E iψ ) (i.e. S i '). And phi (S) iφ,ψ ) In particular, it is understood that the parameter Θ is required according to the coding layer φ Sampling a sequence sample S of discrete characters i The data in (a) is mapped to obtain a vector phi (S) encoded by the encoding layer i ) (i.e. the feature vectors E of each data after the dimension reduction) i ) Then, according to the parameters theta of the decoding layer ψ Vector phi (S) i ) Mapping processing is performed to obtain a reconstructed data sequence phi (S) iφ,ψ )。
Step S804, a third pairing distance between the reconstructed data sequence pairs is determined.
Specifically, a third pairing distance between a reconstructed data sequence pair, i.e., any discrete character sample sequence sample, and any reconstructed data sequence is calculated.
Wherein a third pairing distance between the pair of reconstructed data sequences is determined using the following equation (7):
d3=d(S i ,ψ·φ(S i )) (7)
wherein d3 is the third pairing distance between the reconstructed data sequence pairs, S i I.e. samples of a sequence of discrete character samples, ψ.phi (S i ) I.e. according to the parameters theta of the coding layer φ Sampling a sequence sample S of discrete characters i The data in (a) is mapped to obtain a vector phi (S) encoded by the encoding layer i ) Then, according to the parameters theta of the decoding layer ψ Vector phi (S) i ) A mapping process is performed to obtain a reconstructed data sequence that has been processed both by the encoder and by the decoder.
Step S806, determining a reconstruction loss value according to the number of samples of the discrete character sampling sequence samples and the third pairing distances.
Specifically, the reconstruction loss value is determined by acquiring the number of samples of the discrete character sampling sequence sample and according to the number of samples of the discrete character sampling sequence sample and each third pairing distance.
In one embodiment, the reconstruction loss value is calculated using the following equation (8):
wherein L is R I.e. reconstruction loss value, N s I.e. the number of samples representing the samples of the discrete character sample sequence, d (S i ,ψ·φ(S i ) A third pair of distances,representing samples S of a sequence of discrete character samples during calculation of a reconstruction loss value i Is from the set of data sequences to be screened +.>When the reconstruction loss value is calculated, the whole data sequence set to be screened is required to be traversed >
In one embodiment, after determining the compression loss value from each discrete character sample sequence sample and each reduced-dimension data feature vector, and determining the reconstruction loss value from the discrete character sample sequence sample and the reconstruction data sequence, further comprising:
weighting the reconstruction loss according to the weight parameter corresponding to the reconstruction loss value to obtain a weighted reconstruction loss value; and carrying out summation processing based on the compression loss value and the weighted reconstruction loss value to obtain a fusion loss value.
The method comprises the steps of obtaining a weight parameter corresponding to a reconstruction loss value, carrying out weighting treatment on the reconstruction loss according to the weight parameter to obtain a weighted reconstruction loss value, and carrying out summation treatment on a compression loss value and the weighted reentrant loss value to obtain a fusion loss value.
Further, specifically, the following formula (9) is adopted, and the fusion loss value is calculated:
L=L C +αL R (9)
wherein L is C I.e. compression loss value, L R I.e. the reconstruction loss value, alpha, i.e. the reconstruction loss value L R The corresponding weight parameter can also be understood as being a parameter for balancing the compression loss value L C And reconstructing a loss value L R The super parameters can be set and adjusted according to the actual application scene, and the value of the super parameters is not particularly limited.
In this embodiment, based on each discrete character sampling sequence sample and the reconstructed data sequence, the reconstructed data sequence pair is randomly constructed, and the third pairing distance between the reconstructed data sequence pairs is determined, so that the reconstruction loss value can be determined according to the sample number of the discrete character sampling sequence samples and each third pairing distance, the reconstruction quality of reconstructing the discrete character sampling sequence samples by using the model is evaluated and monitored according to the third pairing distance between the discrete character sampling sequence samples and the reconstructed data sequence pair, and the model training precision is improved.
In one embodiment, as shown in fig. 9, the step of obtaining samples of each discrete character sampling sequence determined based on the data sequence to be screened specifically includes:
step S902, a data sequence to be screened is obtained, and mean value discretization processing is carried out on the data sequence to be screened to obtain a discrete character sequence.
The data sequence to be screened represents an unprocessed original data sequence for sampling for providing a model training sample, and the data sequence to be screened is subjected to mean discretization processing, so that the data in the data sequence to be screened is required to be mapped, and the data sequence to be screened is mapped into a discrete character sequence for representing the data sequence to be screened.
Specifically, the data sequence to be screened is divided into preset subsequences with the same length, the average value corresponding to each subsequence is determined, quantization processing is carried out on the average value corresponding to each subsequence, so that discrete characters corresponding to each subsequence are obtained, and therefore splicing and combination can be carried out on the basis of the discrete characters to obtain the discrete character sequence.
Further, for example, the data sequence to be screened (i.e. the raw data sequence which is not processed) is {1,2,3,4}, the data sequence to be screened {1,2,3,4}, is segmented and then discretized, for example, the data sequence to be screened is divided into two subsequences with the same length, each subsequence contains two points, and then the point average (i.e. the average of the two points is obtained, the average of the subsequences is obtained) of each subsequence is obtained, namely, the real value: {1.5,3.5}, two discrete characters { a }, { b } are obtained by quantizing the two real values, and then the discrete character sequences { a, b } composed of the discrete characters can be spliced. The length of the data sequence to be screened is not specifically limited, the length of the subsequence is not specifically limited, the subsequence can be set and adjusted according to actual requirements, the representation form of the discrete character is not specifically limited, and the discrete character can be expressed by letters or expressed by a two-level system (namely 0 and 1).
Step S904, determining character important bits of each discrete character in the discrete character sequence, and reordering each discrete character in the discrete character sequence according to the character important bits to obtain reordered character sequence.
Before sampling based on the discrete character sequence, reordering the discrete characters according to character importance bits of each discrete character in the discrete character sequence to obtain reordered character sequences, namely sampling is performed specifically on the reordered character sequences to obtain samples of the discrete character sampling sequences. Wherein, the character importance bit of the discrete character can be determined according to the position of each discrete character in the discrete character sequence, namely, the higher the character importance bit level of the discrete character positioned earlier in the discrete character sequence.
Specifically, according to the positions of the discrete characters in the discrete character sequence, determining character important positions of the discrete characters in the discrete character sequence, and according to the character important positions of the discrete characters, reordering the discrete characters according to a character important position decreasing mode to obtain a reordered character sequence.
According to the representation of the discrete characters in the discrete character sequence, the determined character importance bits can specifically comprise a first character importance bit, a second character importance bit and a third character importance bit, and when reordering, the discrete characters are reordered according to the sequence of the first character importance bit, the second character importance bit and the third character importance bit, so that a character sequence which is ordered according to the descending of the character importance bits is obtained.
In one embodiment, as shown in fig. 10, a schematic diagram of reordering discrete characters in a discrete character sequence is provided, and referring to fig. 10, it can be known that a data sequence to be screened is {4,5,1,3}, after discretizing, discrete characters mapped are {100}, {101}, {001}, and {011}, and further, the obtained discrete character sequence is {100,101,001,011}, and character importance bits of different levels are determined according to the position of each discrete character in the discrete character sequence.
Wherein, according to the representation of the discrete characters in the discrete character sequence, the determined character importance bits comprise a first character importance bit, a second character importance bit and a third character importance bit.
Specifically, referring to fig. 10, the first character significant bit of {100} is the first "1", {101} is the first "1", {001} is the first "0", {011} is the first "0", and thus the discrete character sequence corresponding to the first character significant bit is {1100}.
Similarly, the second character significant bit of {100} is middle "0", {101} is middle "0", {001} is middle "0", {011} is middle "1", and thus the discrete character sequence corresponding to the second character significant bit is {0001}. And the third character significant bit of {100} is the last "0", {101} is the last "1", {001} is the last "1", {011} is the last "1", and the discrete character sequence corresponding to the third character significant bit is {0111}.
Further, referring to fig. 10, it is known that {110,000,010,111} discrete character sequences are obtained by sequentially sorting the discrete character sequences corresponding to the first character significant bit {1100}, the discrete character sequences corresponding to the second character significant bit {0001}, and the discrete character sequences corresponding to the third character significant bit {0111}, according to the order of the character significant bits (i.e., sorting in the order from the first character significant bit to the third character significant bit).
It will be appreciated that the discrete character sequence {1100} corresponding to the first character significant bit in the data sequence {4,5,1,3} to be screened is shifted to the first 4 bits of the new character sequence, the resulting first discrete character sequence is {110} with a value of 6, and the discrete character sequence {0001} corresponding to the second character significant bit is shifted to bits 5-8 of the new character sequence, the resulting second discrete character sequence is {000} with a value of 0. Similarly, the discrete character sequence {0111} corresponding to the third character significant bit is shifted to 9-12 bits of the new character sequence, so that the third and fourth discrete character sequences are {010}, {111}, and the last two values are 2 and 7, respectively, to obtain {6,0,2,7} sequences.
By reordering the discrete characters, all important bits appear before all unimportant bits, so that a value array with importance degrees arranged in a descending order is presented, distribution information of a data set can be saved, and sampling efficiency of subsequent similarity search based on the data sequence is improved. Wherein, a re-sampling mode after reordering is adopted, the time complexity is O (nm), the space complexity is O (nl), and the method belongs to an efficient sampling mode.
Step S906, data sampling is carried out based on the character sequence, and each discrete character sampling sequence sample is obtained.
Specifically, when data sampling is performed based on the reordered character sequence, sampling is performed specifically at equal intervals (e.g., once every 1000 sequence samples).
Wherein, the data sequence S= { p to be screened 1 ,…,p m "is a sequence of data points, each point p i =(v i ,t i ),1≤i≤mEach point is associated with a real number v i And position t i Associated, the position corresponds to the order of the values in the sequence, m is the length of the data sequence, andrepresenting the set of data sequences to be screened, i.e. +.>Wherein n is the set of data sequences to be screened +.>Specifically, sampling is performed based on each data sequence to be screened in the data sequence set to be screened, so that the data sequence set to be screened can be sampled to obtain the data sequence set +. >Each corresponding discrete character samples a sequence of samples.
In this embodiment, a data sequence to be screened is obtained, mean value discretization is performed on the data sequence to be screened to obtain a discrete character sequence, character important bits of each discrete character in the discrete character sequence are determined, so that each discrete character in the discrete character sequence is reordered according to the character important bits to obtain a reordered character sequence, all important bits can appear before all unimportant bits, a value array with importance degree arranged in a descending order is presented, and distribution information of a data set can be saved. Further, data sampling is carried out based on the reordered character sequences, so that each discrete character sampling sequence sample is obtained, and the sampling efficiency of the subsequent similarity searching based on the data sequences is further improved.
In one embodiment, as shown in fig. 11, a similarity determination model processing method is provided, which specifically includes the following steps:
step 1101, a data sequence to be screened is obtained, the data sequence to be screened is divided into a plurality of subsequences with the same length, and the average value corresponding to each subsequence is determined.
In step S1102, the average value corresponding to each sub-sequence is quantized to obtain discrete characters corresponding to each sub-sequence, and the discrete characters are spliced and combined based on the discrete characters to obtain a discrete character sequence.
In step S1103, the character importance of each discrete character in the discrete character sequence is determined according to the position of each discrete character in the discrete character sequence.
Step S1104, reorders each discrete character according to the character importance bit of each discrete character in a manner of decreasing the character importance bit, so as to obtain a reordered character sequence.
Step S1105, performing data sampling based on the character sequence to obtain each discrete character sampling sequence sample.
In step S1106, the initial similarity determining model includes an encoding layer and a decoding layer, the encoding layer includes a nonlinear transformation layer and a dimension reduction processing layer, and feature encoding processing is performed on each discrete character sampling sequence sample according to a convolution layer in the nonlinear transformation layer, so as to obtain initial data features.
Step S1107, carrying out residual mapping processing on the initial data features according to the multi-layer residual blocks in the nonlinear transformation layer to obtain residual mapping data, and superposing the residual mapping data and the initial data features to obtain intermediate data features.
Step S1108, performing normalization processing, nonlinear fitting processing and pooling processing on the intermediate data features according to the normalization layer, the nonlinear activation layer and the pooling layer in the nonlinear transformation layer to obtain the sequence data features.
In step S1109, vector conversion processing and nonlinear conversion processing are performed on the sequence data feature through the full connection layer and the nonlinear activation layer in the dimension reduction processing layer, so as to obtain a sequence feature vector.
Step S1110, a preset sum of squares matrix corresponding to the sequence sum of squares invariant processing logic is obtained, and row data and column data corresponding to each sequence feature vector are determined based on the preset sum of squares matrix.
Step S1111, determining the square sum corresponding to each sequence feature vector according to the row data and the column data corresponding to each sequence feature vector.
Step S1112, based on the target normalization layer in the dimension reduction processing layer, performing standardization processing on each sequence feature vector, and performing sequence scaling and dimension reduction processing on the standardized sequence feature vector according to the sequence square sum invariant processing logic to obtain each data feature vector after dimension reduction.
Step S1113, according to the full connection layer and the nonlinear activation layer in the decoding layer, vector conversion processing and nonlinear conversion processing are carried out on the data feature vector after the dimension reduction, and the reconstructed data sequence feature vector is obtained.
And step S1114, performing feature encoding processing on the feature vectors of the reconstructed data sequence according to the convolution layers in the decoding layers to obtain the features of the initial reconstructed data sequence.
Step S1115, performing residual mapping processing and data feature superposition processing based on the initial reconstructed data sequence feature according to the multi-layer residual block in the decoding layer, to obtain an intermediate reconstructed data feature.
Step S1116, the normalization layer, the nonlinear activation layer and the pooling layer in the decoding layer are utilized to sequentially perform normalization processing, nonlinear fitting processing and pooling processing on the intermediate reconstructed data characteristics, so as to obtain reconstructed data sequence characteristics.
Step S1117, performing multi-layer linear processing and normalization processing based on the characteristics of the reconstructed data sequence by using the multi-layer full connection layer, the nonlinear activation layer and the normalization layer in the decoding layer, to obtain the reconstructed data sequence.
Step S1118, constructing and obtaining an original data sequence pair according to any two discrete character sampling sequence samples, determining a first pairing distance between the original data sequence pairs, randomly constructing discrete data pairs based on the data feature vectors after dimension reduction, and determining a second pairing distance between the discrete data pairs.
Step S1119, obtaining the number of samples of the discrete character sampling sequence sample and the vector number of each data feature vector after dimension reduction, performing sequence scaling processing on the first pairing distance according to the number of samples to obtain a first scaling pairing distance, and performing sequence scaling processing on the second pairing distance according to the number of vectors to obtain a second scaling pairing distance.
Step S1120, the number of sequence pairs of the original data sequence pairs is obtained, and the compression loss value is determined according to the number of sequence pairs, each first scaling pair distance, and each second scaling pair distance.
Step S1121, randomly constructing a reconstructed data sequence pair based on each discrete character sampling sequence sample and the reconstructed data sequence.
Step S1111, determining a third pairing distance between the reconstructed data sequence pairs, and determining a reconstruction loss value according to the number of samples of the discrete character sampling sequence samples and each third pairing distance.
Step S1123, weighting the reconstruction loss according to the weight parameter corresponding to the reconstruction loss, obtaining a weighted reconstruction loss, and summing the weighted reconstruction loss based on the compression loss and the weighted reconstruction loss to obtain a fusion loss.
In step S1124, if it is determined that the fusion loss value reaches the preset loss threshold corresponding to the model training end condition, the model training is determined to end, and the initial similarity determination model at the end of the training is determined to be the trained similarity determination model.
In one embodiment, as shown in fig. 12, a model architecture schematic of a similarity determination model is provided, and referring to fig. 12, the similarity determination model includes an encoding layer and a decoding layer, where the encoding layer includes a nonlinear transformation layer and a dimension reduction processing layer, the nonlinear transformation layer includes a convolution layer (i.e., a CNN layer of the encoding layer of fig. 12), a multi-layer residual block (i.e., a K-layer residual block of the encoding layer of fig. 12), each residual block includes a stacked structure of a plurality of normalization layers, a nonlinear activation layer, and a convolution layer, a first normalization layer (i.e., a LayerNorm layer located after the K-layer residual block in the encoding layer of fig. 12), a first nonlinear activation layer (i.e., a RELU function activation layer of the encoding layer of fig. 12), and a pooling layer (i.e., a MaxPool layer of the encoding layer of fig. 12).
Wherein, the dimension reduction treatment layer specifically comprises: the first fully connected layer (i.e., the first linear layer located after the MaxPool layer in the coding layer of fig. 12), the second nonlinear active layer (i.e., the Tanh function active layer of the coding layer of fig. 12), the second fully connected layer (i.e., the second linear layer located after the Tanh function active layer in the coding layer of fig. 12), and the second normalized layer (which may also be understood as a target normalized layer for achieving final processing of the output data of the coding layer, i.e., the LayerNorm layer located after the second linear layer in the coding layer of fig. 12).
Specifically, each component in the coding layer is utilized to sample the sequence sample of each discrete character, nonlinear transformation processing and dimension reduction processing are carried out to obtain each data characteristic vector after dimension reduction, and each component in the decoding layer of the model is further utilized to carry out data reconstruction processing to each data characteristic vector after dimension reduction to obtain a reconstructed data sequence.
Further, the decoding layer specifically includes a plurality of full-connection layers, a plurality of nonlinear activation layers, a convolution layer, a plurality of residual blocks (such as K-layer residual blocks, each of which includes a stacked structure of a plurality of normalization layers, nonlinear activation layers, and convolution layers), a normalization layer, a pooling layer, and the like. Referring to fig. 12, the decoding layer specifically includes a third connection layer (i.e., the first linear layer of the decoding layer of fig. 12), a second non-linear activation layer (i.e., the Tanh function activation layer of the decoding layer of fig. 12), a convolution layer (i.e., the CNN layer of the decoding layer of fig. 12), a multi-layer residual block (i.e., the K layer residual block of the decoding layer of fig. 12), a third normalization layer (i.e., the LayerNorm layer located after the K layer residual block in the decoding layer of fig. 12), a first non-linear activation layer (i.e., the RELU function activation layer of the decoding layer of fig. 12), a pooling layer (i.e., the MaxPool layer of the decoding layer of fig. 12), a fourth full connection layer (i.e., the Tanh function activation layer of the decoding layer of fig. 12), and a fifth full connection layer (i.e., the third linear layer located after the Tanh function activation layer in the decoding layer of fig. 12), and a fourth full connection layer (i.e., the last linear layer in the decoding layer of fig. 12).
The encoding layer and the decoding layer may have different structures (i.e., not limited to one-to-one corresponding component structures, and may be adjusted and set according to actual application scenarios or requirements), and the decoding layer may adjust positions of different data in the discretized data sequence in the similarity search application program, so that the result may be converted into a better index structure, and more effective similarity search may be implemented, thereby improving accuracy of the target object determined by the similarity search.
In the similarity determination model processing method, the discrete character sampling sequence samples determined based on the data sequences to be screened are obtained, the coding layer of the model is determined according to the initial similarity, nonlinear transformation processing and dimension reduction processing are carried out on the discrete character sampling sequence samples, and the dimension-reduced data feature vectors are obtained, so that the model can learn information in the discrete character sampling sequence samples better in the training process, and the summarization learning of the discrete sample sequences with low dimension is realized. Further, based on a decoding layer of the initial similarity determination model, carrying out data reconstruction processing on each data feature vector after dimension reduction to obtain a reconstructed data sequence, determining a compression loss value according to each discrete character sampling sequence sample and each data feature vector after dimension reduction in the training process, determining a reconstruction loss value according to the discrete character sampling sequence sample and the reconstructed data sequence, obtaining a trained similarity determination model when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition, and reducing error data in the model training process and improving the trained model precision by comprehensively considering training losses among different components, sampling sequence samples, intermediate results, reconstructed data sequences and the like in the model training process so as to improve the accuracy of a target object matched with search information when the subsequent similarity determination model searches for the candidate data sequence set based on the trained similarity.
In one embodiment, as shown in fig. 13, a target object searching method is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
in step S1302, if the target object search request is detected, search information corresponding to the target object search request is acquired.
Specifically, if a target object search request triggered by the application program running on the basis of the terminal equipment or the application website, the system and the like is detected, search information corresponding to the target object search request is obtained. The application program or application website operated by the terminal device can be a data platform for service scenes such as advertisement recommendation and information recommendation, and the like, and can perform similarity search based on the corresponding platforms or programs of the service scenes to determine a target object for service recommendation. The search information may specifically be an object to be searched specifically, a specific search question to be searched for an answer, and the like.
In step S1304, a set of candidate data sequences is acquired.
Wherein the candidate data sequence setComprising a plurality of candidate data sequences S', i.e.>Representing the set of data sequences to be screened, i.e. +.>Where n is the size of the set of data sequences to be screened. Data sequence to be screened S' = { p 1 ,...,p m "is a sequence of data points, each point p i =(v i ,t i ) I is more than or equal to 1 and less than or equal to m, and each point is combined with a real number v i And position t i In association, the positions correspond to the order of the values in the sequence, m being the length of the data sequence.
In one embodiment, a set of candidate data sequencesIs represented by E' = { E 1 ,...,e l By reserving a set of candidate data sequences +.>Wherein the search target attribute for similarity is the candidate data sequence set +.>Is specifically represented by the following formula (10):
wherein E 'is' i ,E j 'is S' i ,S′ j (summary space can be understood as a dimension-reduced space representation after encoding and compression, and the performance of similarity retrieval can be improved and complicated operations can be reduced by retrieving after encoding and compression), d (S' i ,S′ j ) And d '(E' i ,E′ j ) Representing distance measurements in candidate data sequences and in the summary space, d ' (E ', respectively ' i ,E′ j )≈d(S′ i ,S′ j ) It is understood that the similarity searches for target attributes, particularly distance measurement approximations in candidate data sequences, and in the summary space.
In one embodiment, since d' need not be the same as d in the summary space, a query sequence S of length m is given q Candidate data sequence set with size n and length lAnd a distance measure d, the object of which is to identify the distance S q Nearest sequence->Specifically, the expression is represented by the following formula (11):
wherein S' o Refers to a set of candidate data sequencesIn (3) except S' c Other than one of the sequences, S' c Is with S q The most similar sequence, d (S' c ,S q )≤d(S′ o ,S q ) Representing S' c And S is equal to q Is smaller than the pair-wise distance between any other pair of sequences, i.e. S' c Is the candidate data sequence set to be searched +.>Middle and S q The data sequence with the smallest distance.
Further, in order to improve the similar searching efficiency, the search is performed with S q When the data sequence with the minimum distance is not used for directly searching the nearest sequence S' c But rather by means of approximate similarity search, which aims at finding a sequenceI.e. not required to find the sum S q S 'of minimum distance' c But find the sum S' c S 'of close distance' c1 Specifically, the expression is represented by the following formula (12):
wherein d (S' c1 ,S q ) I.e. sequence S' c1 And query sequence S q Distance between each other, and d (S' c ,S q ) I.e. sequence S' c And query sequence S q The distance between the two objects is that the current approximate similarity search target is to find the distance S' c S 'of close distance' c1The expression sequence S' c And query sequence S q Distance between, sequence S' c1 And query sequence S q The ratio between the distances between, andi.e. the ratio between the two distances should be at (0, 1]Is within the range of the value of (2).
It can be understood thatIn accordance with a given query sequence S q For candidate data sequence setWhen similarity searching is carried out, a mode of approximate similarity searching is adopted, and the approximate similarity searching target is to search for a sequence +.>I.e. not required to find the sum S q S 'of minimum distance' c But find the sum S' c S 'of close distance' c1 The complex searching operation and resource consumption can be reduced, and the searching efficiency and performance are further improved.
Step S1306, performing depth discretization processing on each candidate data sequence in the candidate data sequence set according to the trained similarity determination model to obtain a depth discretization data sequence, performing similarity search based on the depth discretization data sequence, and determining a target object matched with the search information.
The trained similarity determination model is obtained when the calculated fusion loss value meets the model training ending condition in the training process of the initial similarity determination model according to each discrete character sampling sequence sample; the fusion loss value is obtained by determining a compression loss value according to each discrete character sampling sequence sample and each data characteristic vector after dimension reduction and a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence; the data feature vectors after the dimension reduction are obtained by performing nonlinear transformation processing and dimension reduction processing on the discrete character sampling sequence samples according to an encoding layer of the initial similarity determination model, and the reconstructed data sequence is obtained by performing data reconstruction processing on the data feature vectors after the dimension reduction based on a decoding layer of the initial similarity determination model.
Specifically, according to the trained similarity determination model, performing depth discretization processing on each candidate data sequence in the candidate data sequence set to obtain a depth discretization data sequence, constructing a data sequence discretization index according to each depth discretization data sequence, and further performing similarity search based on the data sequence discretization index to determine a target object matched with search information.
The data sequence dimension reduction mode is carried out based on the trained similarity determination model, deep embedding discretization of each candidate data sequence in the candidate data sequence set is achieved, and high-quality data sequence dimension reduction and similarity search results are provided. Specifically, when the similarity search is performed, the similarity answer corresponding to the search information is specifically queried and generated, that is, instead of directly querying the answer which is completely matched with (or completely the same as) the search information, a similar answer similar to the answer of the search information is searched, and the similar answer similar to the answer is taken as a target object, so that a series of complicated operations required to be performed due to the need of accurate answer can be reduced, and the search efficiency can be improved.
In the target object searching method, if the target object searching request is detected, the searching information corresponding to the target object searching request is obtained, the candidate data sequence set is obtained, the depth discretization processing is carried out on each candidate data sequence in the candidate data sequence set according to the trained similarity determination model, the depth discretization data sequence is obtained, the high-quality dimension reduction processing of each candidate data sequence is realized, the important characteristic information of each candidate data sequence is reserved, the similarity searching is carried out based on the depth discretization data sequence, the target object matched with the searching information is determined, and the accuracy of the target object matched with the searching information is improved when the similarity searching of the candidate data sequence set is carried out according to the trained similarity determination model.
In one embodiment, as shown in fig. 14, the step of obtaining a depth discretized data sequence, that is, performing a depth discretization process on each candidate data sequence in the candidate data sequence set according to the trained similarity determination model, includes the steps of:
step S1402, according to the coding layer, performs nonlinear transformation processing and dimension reduction processing on each candidate data sequence, and obtains each candidate data feature vector after dimension reduction.
Specifically, the trained similarity determination model comprises a coding layer and a decoding layer, the coding layer comprises a nonlinear transformation processing layer and a dimension reduction processing layer, and further nonlinear transformation processing and dimension reduction processing can be carried out on each candidate data sequence according to the nonlinear transformation layer and the dimension reduction processing layer, so that each candidate data feature vector after dimension reduction is obtained.
The nonlinear transformation layer specifically may include a convolution layer, a multi-layer residual block, a normalization layer, a nonlinear activation layer, and a pooling layer. According to the convolution layer in the nonlinear transformation layer, feature encoding processing and data feature extraction can be performed on each candidate data sequence, so as to obtain initial candidate data features corresponding to each candidate data sequence.
While a multi-layer residual block may be understood as a superposition of multiple residual blocks (e.g., a superposition of K-layer residual blocks), with each residual block in the multi-layer residual block, a residual mapping process may be performed on the initial candidate data characteristics to obtain residual mapped data. And the residual mapping data obtained by carrying out residual mapping processing is used for being overlapped with the initial candidate data characteristics of the input residual block so as to obtain intermediate candidate data characteristics. The normalization layer, the nonlinear activation layer and the pooling layer are used for performing normalization processing, nonlinear fitting processing and pooling processing on the intermediate data features, so that candidate sequence data features are obtained.
Similarly, the dimension reduction processing layer specifically comprises a plurality of full-connection layers, a nonlinear activation layer and a target normalization layer, wherein vector conversion processing and nonlinear activation processing are carried out on candidate sequence data features through the full-connection layers and the nonlinear activation layer to obtain candidate sequence feature vectors, dimension reduction processing is carried out on each candidate sequence feature vector according to a sequence square sum invariant processing logic based on the target normalization layer, and each candidate data feature vector after dimension reduction is obtained.
The method comprises the steps of obtaining a preset square sum matrix set for a sequence square sum invariant processing logic, and calculating the peace square corresponding to candidate sequence feature vectors according to the preset square sum matrix, so that the target normalization layer is utilized, and dimension reduction processing is carried out on each candidate sequence feature vector according to the sequence square sum invariant processing logic, namely, the dimension reduction processing is carried out on each candidate sequence feature vector, and meanwhile the square sum of each candidate sequence feature vector is kept unchanged, so that each candidate data feature vector after dimension reduction is obtained.
Step S1404, based on the decoding layer, performing data reconstruction processing on each candidate data feature vector after the dimension reduction, to obtain a reconstructed candidate data sequence.
Wherein the decoding layer of the initial similarity determination model comprises: multi-layer full-link layer, multi-layer nonlinear active layer, convolutional layer, multi-layer residual block (such as K-layer residual block, each of which includes a stacked structure of multiple normalization layers, nonlinear active layers, and convolutional layers), normalization layers, and pooling layers, etc.
Specifically, a full connection layer and a nonlinear activation layer in a decoding layer are utilized to perform vector conversion processing and nonlinear activation processing on the candidate data feature vectors after dimension reduction to obtain reconstructed candidate data feature vectors, and a convolution layer is utilized to perform feature extraction processing on the reconstructed candidate data feature vectors to obtain initial reconstructed candidate data sequence features corresponding to the reconstructed candidate data feature vectors.
And performing residual mapping processing and data feature superposition processing on the initial reconstruction candidate data sequence features by using each residual block in the multi-layer residual blocks to obtain intermediate reconstruction candidate data features, and performing normalization processing, nonlinear fitting processing and pooling processing on the intermediate reconstruction candidate data features by using a normalization layer, a nonlinear activation layer and a pooling layer to obtain the reconstruction candidate data sequence features.
Further, the reconstructed candidate data sequence features are subjected to further multi-layer linear processing and normalization processing by utilizing the multi-layer full-connection layer, the nonlinear activation layer and the normalization layer, so that reconstructed candidate data sequences are obtained.
Step S1406, performing a deep discretization process on each reconstructed candidate data sequence to obtain candidate discrete characters corresponding to each reconstructed candidate data sequence.
Specifically, the trained similarity determination model is utilized to carry out deep discretization processing on the reconstructed candidate data sequence, mapping processing is carried out on data in the reconstructed candidate data sequence, and the reconstructed candidate data sequence is mapped into candidate discrete characters for representing the reconstructed candidate data sequence.
In step S1408, the character importance bits of each candidate discrete character are determined, and the candidate discrete characters are reordered according to the decreasing character importance bits of each candidate discrete character, so as to obtain a depth discretized data sequence.
Specifically, a candidate discrete character sequence is obtained according to the splicing of each candidate discrete character, the position of each candidate discrete character in the candidate discrete character sequence is obtained, and the character importance of each candidate discrete character is determined. Wherein the character importance of the discrete characters may be determined based on the position of each discrete character in the candidate discrete character sequence, i.e., the higher the character importance level of the preceding discrete character in the candidate discrete character sequence. And reordering the candidate discrete characters according to the character importance decreasing mode of the candidate discrete characters to obtain a depth discretization data sequence.
Further, according to the representation of the candidate discrete characters in the candidate discrete character sequence, the determined character importance bits may specifically include a first character importance bit, a second character importance bit and a third character importance bit, and when reordering is performed, each candidate discrete character is reordered according to the order of the first character importance bit, the second character importance bit and the third character importance bit, so as to obtain a depth discretization data sequence according to descending order of the character importance bits.
In this embodiment, nonlinear transformation processing and dimension reduction processing are performed on each candidate data sequence according to the encoding layer, each candidate data feature vector after dimension reduction is obtained, and data reconstruction processing is performed on each candidate data feature vector after dimension reduction based on the decoding layer, so as to obtain a reconstructed candidate data sequence. Further, by performing depth discretization processing on each reconstructed candidate data sequence to obtain candidate discrete characters corresponding to each reconstructed candidate data sequence, and determining character important bits of each candidate discrete character, each candidate discrete character can be reordered according to a decreasing character important bit mode of each candidate discrete character to obtain a depth discretization data sequence, and the depth discretization data sequence corresponding to each candidate data sequence is obtained by adopting the depth discretization and reordering modes, so that all important bits appear before all unimportant bits to present a value array with importance degree arranged in a decreasing order, distribution information of a candidate data sequence set can be saved, search times of characters with unimportant bits in a search process can be reduced, and the efficiency of subsequent similarity search based on the candidate data sequence is improved.
In one embodiment, as shown in fig. 15, a complete process for searching for a target object is provided, specifically including the process of discretizing a data sequence, and generating an index and obtaining an approximate query response, where:
p1, discretizing a data sequence, which specifically comprises the following steps:
a1, acquiring a data sequence to be screened, and sampling based on the data sequence to be screened according to a sampling strategy to obtain each discrete character sampling sequence sample.
Specifically, a data sequence to be screened is obtained, mean value discretization processing is carried out on the data sequence to be screened to obtain a discrete character sequence, character important bits of each discrete character in the discrete character sequence are determined, each discrete character in the discrete character sequence is reordered according to the character important bits to obtain a reordered character sequence, and data sampling is carried out on the basis of the character sequence to obtain a sample of each discrete character sampling sequence.
The method comprises the steps of dividing a data sequence to be screened into subsequences with the same preset length, determining the average value corresponding to each subsequence, carrying out quantization processing on the average value corresponding to each subsequence, and obtaining discrete characters corresponding to each subsequence, so that splicing and combining are carried out based on the discrete characters to obtain a discrete character sequence.
Further, according to the positions of the discrete characters in the discrete character sequence, determining character important positions of the discrete characters in the discrete character sequence, and according to the character important positions of the discrete characters, reordering the discrete characters in a mode of decreasing the character important positions to obtain a reordered character sequence.
In one embodiment, taking {4,5,1,3} as an example of the data sequence to be screened, discretizing the data sequence, and mapping to obtain discrete characters of {100}, {101}, {001}, {011}, and further obtaining a discrete character sequence of {100,101,001,011}, and determining character importance bits of different levels according to the position of each discrete character in the discrete character sequence. In this embodiment, according to the representation of the discrete characters in the discrete character sequence, the determined character importance bits include a first character importance bit, a second character importance bit and a third character importance bit.
Specifically, the first character significant bit of {100} is the first "1", the first character significant bit of {101} is the first "1", the first character significant bit of {001} is the first "0", and the first character significant bit of {011} is the first "0", so that the discrete character sequence corresponding to the first character significant bit is {1100}.
Similarly, the second character significant bit of {100} is middle "0", {101} is middle "0", {001} is middle "0", {011} is middle "1", and thus the discrete character sequence corresponding to the second character significant bit is {0001}. And the third character significant bit of {100} is the last "0", {101} is the last "1", {001} is the last "1", {011} is the last "1", and the discrete character sequence corresponding to the third character significant bit is {0111}.
Further, by sequentially sorting the discrete character sequence corresponding to the first character significant bit into {1100}, the discrete character sequence corresponding to the second character significant bit into {0001}, and the discrete character sequence corresponding to the third character significant bit into {0111}, the discrete character sequences can be obtained as {110,000,010,111}, in order of the character significant bits (i.e., in order from the first character significant bit to the third character significant bit).
A2, training the initial similarity determination model according to each discrete character sampling sequence sample, and obtaining a trained similarity determination model when the model training ending condition is met.
Specifically, according to an initial similarity determining model, a coding layer performs nonlinear transformation processing and dimension reduction processing on each discrete character sampling sequence sample to obtain each data feature vector after dimension reduction, and based on a decoding layer of the initial similarity determining model, performs data reconstruction processing on each data feature vector after dimension reduction to obtain a reconstructed data sequence. Further, in the training process, a compression loss value is determined according to each discrete character sampling sequence sample and each data feature vector after dimension reduction, a reconstruction loss value is determined according to the discrete character sampling sequence sample and the reconstruction data sequence, and a trained similarity determination model is obtained when a fusion loss value determined according to the compression loss value and the reconstruction loss value meets a model training ending condition.
The coding layer comprises a nonlinear transformation layer and a dimension reduction processing layer, and specifically performs nonlinear transformation processing on each discrete character sampling sequence sample according to the nonlinear transformation layer to obtain sequence data characteristics corresponding to each discrete character sampling sequence sample, and performs dimension reduction processing on each sequence data characteristic according to a sequence square and invariant processing logic based on the dimension reduction processing layer to obtain each data characteristic vector after dimension reduction.
In one embodiment, the nonlinear transformation layer includes a plurality of residual blocks, each residual block includes a superposition structure of a plurality of normalization layers, a nonlinear activation layer and a convolution layer, and specifically, the characteristic coding processing is performed on each discrete character sampling sequence sample to obtain an initial data characteristic, the residual mapping processing is performed on the initial data characteristic according to each residual block in the plurality of residual blocks to obtain residual mapping data, the residual mapping data and the initial data characteristic are superposed to obtain an intermediate data characteristic, and finally, the normalization processing, the nonlinear fitting processing and the pooling processing are performed on the intermediate data characteristic to obtain a sequence data characteristic.
Similarly, the dimension reduction processing layer comprises a plurality of full-connection layers, nonlinear activation layers and target normalization layers, and specifically, vector conversion processing and nonlinear transformation processing are performed on the sequence data features through the full-connection layers and the nonlinear activation layers to obtain sequence feature vectors, dimension reduction processing is performed on the sequence feature vectors according to sequence square sum invariant processing logic based on the target normalization layers to obtain dimension reduced data feature vectors.
Further, specifically, a preset square sum matrix corresponding to the sequence square sum invariant processing logic is obtained, row data and column data corresponding to each sequence feature vector are determined based on the preset square sum matrix, and square sums corresponding to each sequence feature vector are determined according to the row data and the column data corresponding to each sequence feature vector. Further, the normalization processing is carried out on each sequence feature vector based on the target normalization layer, and the sequence scaling and the dimension reduction processing are carried out on the normalized sequence feature vector according to the sequence square sum invariant processing logic, so that each data feature vector after dimension reduction is obtained.
In one embodiment, based on the decoding layer of the initial similarity determination model, performing data reconstruction processing on each data feature vector after dimension reduction, and when obtaining a reconstructed data sequence, the method is specifically implemented by the following steps:
and carrying out vector conversion processing and nonlinear transformation processing on the data characteristic vector after the dimension reduction based on a decoding layer of the initial similarity determination model to obtain a reconstructed data sequence characteristic vector, and carrying out characteristic coding processing on the reconstructed data sequence characteristic vector to obtain initial reconstructed data sequence characteristics. Further, residual mapping processing and data feature superposition processing are performed based on the initial reconstructed data sequence features to obtain intermediate reconstructed data features, normalization processing, nonlinear fitting processing and pooling processing are performed on the intermediate reconstructed data features to obtain reconstructed data sequence features, and finally multi-layer linear processing and normalization processing can be performed based on the reconstructed data sequence features to obtain a reconstructed data sequence.
In one embodiment, determining the compression loss value from each discrete character sample sequence sample and each reduced-dimension data feature vector comprises:
and constructing and obtaining an original data sequence pair according to any two discrete character sampling sequence samples, determining a first pairing distance between the original data sequence pairs, randomly constructing discrete data pairs based on the data feature vectors after dimension reduction, and determining a second pairing distance between the discrete data pairs. Further, by acquiring the number of samples of the discrete character sampling sequence samples and the vector number of each data feature vector after dimension reduction, performing sequence scaling processing on the first pairing distance according to the number of samples to obtain a first scaling pairing distance, performing sequence scaling processing on the second pairing distance according to the number of vectors to obtain a second scaling pairing distance, acquiring the number of sequence pairs of the original data sequence pairs, and determining a compression loss value according to the number of sequence pairs, each first scaling pairing distance and each second scaling pairing distance.
In one embodiment, determining a reconstruction loss value from the discrete character sample sequence samples and the reconstruction data sequence includes:
based on each discrete character sampling sequence sample and the reconstruction data sequence, randomly constructing a reconstruction data sequence pair, and determining a third pairing distance between the reconstruction data sequence pairs, so as to determine a reconstruction loss value according to the sample number of the discrete character sampling sequence samples and each third pairing distance.
Wherein after determining the compression loss value and the reconstruction loss value, further comprising: and carrying out weighting treatment on the reconstruction loss according to the weight parameter corresponding to the reconstruction loss value to obtain a weighted reconstruction loss value, and carrying out summation treatment on the basis of the compression loss value and the weighted reconstruction loss value to obtain a fusion loss value.
Further, if the fusion loss value reaches the preset loss threshold value corresponding to the model training ending condition, ending the model training is determined, and the initial similarity determination model after the training is ended is determined to be a trained similarity determination model.
A3, obtaining a candidate data sequence set, determining a model according to the trained similarity, and performing depth discretization on each candidate data sequence in the candidate data sequence set to obtain a depth discretized data sequence.
Specifically, the trained similarity determination model comprises a coding layer and a decoding layer, nonlinear transformation processing and dimension reduction processing are carried out on each candidate data sequence according to the coding layer, each candidate data feature vector after dimension reduction is obtained, data reconstruction processing is carried out on each candidate data feature vector after dimension reduction based on the decoding layer, a reconstructed candidate data sequence is obtained, depth discretization processing is carried out on each reconstructed candidate data sequence, and candidate discrete characters corresponding to each reconstructed candidate data sequence are obtained.
The encoding layer comprises a nonlinear transformation processing layer and a dimension reduction processing layer, and further according to the nonlinear transformation layer and the dimension reduction processing layer, nonlinear transformation processing and dimension reduction processing can be carried out on each candidate data sequence in the candidate data sequence set, so that each candidate data feature vector after dimension reduction is obtained.
In particular, the nonlinear transformation layer may specifically include a convolution layer, a multi-layer residual block, a normalization layer, a nonlinear activation layer, and a pooling layer. According to the convolution layer in the nonlinear transformation layer, feature encoding processing and data feature extraction can be performed on each candidate data sequence, so as to obtain initial candidate data features corresponding to each candidate data sequence. While a multi-layer residual block may be understood as a superposition of multiple residual blocks (e.g., a superposition of K-layer residual blocks), with each residual block in the multi-layer residual block, a residual mapping process may be performed on the initial candidate data characteristics to obtain residual mapped data. And the residual mapping data obtained by carrying out residual mapping processing is used for being overlapped with the initial candidate data characteristics of the input residual block so as to obtain intermediate candidate data characteristics. The normalization layer, the nonlinear activation layer and the pooling layer are used for performing normalization processing, nonlinear fitting processing and pooling processing on the intermediate data features, so that candidate sequence data features are obtained.
Similarly, the dimension reduction processing layer specifically comprises a plurality of full-connection layers, a nonlinear activation layer and a target normalization layer, wherein vector conversion processing and nonlinear activation processing are carried out on candidate sequence data features through the full-connection layers and the nonlinear activation layer to obtain candidate sequence feature vectors, dimension reduction processing is carried out on each candidate sequence feature vector according to a sequence square sum invariant processing logic based on the target normalization layer, and each candidate data feature vector after dimension reduction is obtained.
The method comprises the steps of obtaining a preset square sum matrix set for a sequence square sum invariant processing logic, and calculating the peace square corresponding to candidate sequence feature vectors according to the preset square sum matrix, so that the target normalization layer is utilized, and dimension reduction processing is carried out on each candidate sequence feature vector according to the sequence square sum invariant processing logic, namely, the dimension reduction processing is carried out on each candidate sequence feature vector, and meanwhile the square sum of each candidate sequence feature vector is kept unchanged, so that each candidate data feature vector after dimension reduction is obtained.
In one embodiment, the decoding layer includes: multi-layer full-link layer, multi-layer nonlinear active layer, convolutional layer, multi-layer residual block (such as K-layer residual block, each of which includes a stacked structure of multiple normalization layers, nonlinear active layers, and convolutional layers), normalization layers, and pooling layers, etc.
Specifically, a full connection layer and a nonlinear activation layer in a decoding layer are utilized to perform vector conversion processing and nonlinear activation processing on the candidate data feature vectors after dimension reduction to obtain reconstructed candidate data feature vectors, and a convolution layer is utilized to perform feature extraction processing on the reconstructed candidate data feature vectors to obtain initial reconstructed candidate data sequence features corresponding to the reconstructed candidate data feature vectors.
And performing residual mapping processing and data feature superposition processing on the initial reconstruction candidate data sequence features by using each residual block in the multi-layer residual blocks to obtain intermediate reconstruction candidate data features, and performing normalization processing, nonlinear fitting processing and pooling processing on the intermediate reconstruction candidate data features by using a normalization layer, a nonlinear activation layer and a pooling layer to obtain the reconstruction candidate data sequence features. Further, the reconstructed candidate data sequence features are subjected to further multi-layer linear processing and normalization processing by utilizing the multi-layer full-connection layer, the nonlinear activation layer and the normalization layer, so that reconstructed candidate data sequences are obtained.
Further, the trained similarity determination model is utilized to carry out deep discretization processing on the reconstructed candidate data sequence, mapping processing is carried out on the data in the reconstructed candidate data sequence, the reconstructed candidate data sequence is mapped into candidate discrete characters for representing the reconstructed candidate data sequence, character importance bits of the candidate discrete characters are determined, and the candidate discrete characters are reordered according to a mode that the character importance bits of the candidate discrete characters are decreased, so that the deep discretization data sequence is obtained.
And splicing the candidate discrete characters to obtain a candidate discrete character sequence, acquiring the positions of the candidate discrete characters in the candidate discrete character sequence, and determining character importance bits of the candidate discrete characters. Wherein the character importance of the discrete characters may be determined based on the position of each discrete character in the candidate discrete character sequence, i.e., the higher the character importance level of the preceding discrete character in the candidate discrete character sequence.
P2, the processing procedure of generating an index and obtaining the approximate answer of the query specifically comprises the following steps:
b1, constructing a data sequence discretization index according to each depth discretization data sequence.
Specifically, each depth discretized data sequence is obtained and structured into a tree index structure, namely, a data sequence discretized index is constructed and obtained and used for supporting similarity search of the data sequence.
And B2, if the target object search request is detected, acquiring search information corresponding to the target object search request.
Specifically, if a target object search request triggered by the application program running on the basis of the terminal equipment or the application website, the system and the like is detected, search information corresponding to the target object search request is obtained. The search information may specifically be an object to be searched specifically, a specific search question to be searched for an answer, and the like.
And B3, performing similarity search based on the data sequence discretization index, and determining a target object matched with the search information.
Specifically, based on the data sequence discretization index, similarity search is performed, and a target object matched with search information is determined.
When the similarity search is performed, the similarity answer corresponding to the search information is specifically queried and generated, that is, instead of directly querying the answer which is completely matched with (or completely the same as) the search information, a similar answer similar to the answer of the search information is searched, and the similar answer similar to the answer is taken as a target object, so that a series of complicated operations required to be performed due to the need of accurate answer can be reduced, and the search efficiency can be improved.
In the target object searching process, the data sequence to be screened is obtained, sampling is carried out based on the data sequence to be screened according to a sampling strategy, each discrete character sampling sequence sample is obtained, the initial similarity determination model is trained according to each discrete character sampling sequence sample, and the trained similarity determination model is obtained when the model training ending condition is met. Further, a candidate data sequence set is obtained, a model is determined according to the trained similarity, depth discretization processing is conducted on each candidate data sequence in the candidate data sequence set, a depth discretization data sequence is obtained, and a data sequence discretization index is built according to each depth discretization data sequence. If the target object search request is detected, search information corresponding to the target object search request is acquired, and similarity search is performed based on the data sequence discretization index, so that a target object matched with the search information is determined.
It should be understood that, although the steps in the flowcharts related to the above embodiments are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a similarity determination model processing device for realizing the similarity determination model processing method and a target object searching device for realizing the target object searching method. The implementation of the solution provided by the apparatus is similar to the implementation described in the above method, so the specific limitations in the embodiments of the one or more similarity determination model processing apparatuses and the target object searching apparatus provided below may be referred to the above limitations on the similarity determination model processing method and the target object searching method, which are not described herein.
In one embodiment, as shown in fig. 16, there is provided a similarity determination model processing apparatus including: a discrete character sampling sequence sample acquisition module 1602, a dimension reduction processing module 1604, a data reconstruction processing module 1606, and a similarity determination model acquisition module 1608, wherein:
a discrete character sampling sequence sample acquiring module 1602, configured to acquire each discrete character sampling sequence sample determined based on the data sequence to be screened;
the dimension reduction processing module 1604 is configured to determine an encoding layer of the model according to the initial similarity, perform nonlinear transformation processing and dimension reduction processing on each discrete character sampling sequence sample, and obtain each data feature vector after dimension reduction;
the data reconstruction processing module 1606 is configured to determine a decoding layer of the model based on the initial similarity, perform data reconstruction processing on each of the data feature vectors after the dimension reduction, and obtain a reconstructed data sequence;
the similarity determination model obtaining module 1608 is configured to determine a compression loss value according to each discrete character sampling sequence sample and each data feature vector after dimension reduction in the training process, determine a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence, and obtain a trained similarity determination model when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training end condition.
In the similarity determination model processing device, the discrete character sampling sequence samples determined based on the data sequences to be screened are obtained, the coding layer of the model is determined according to the initial similarity, nonlinear transformation processing and dimension reduction processing are carried out on the discrete character sampling sequence samples, and the dimension-reduced data feature vectors are obtained, so that the model can learn information in the discrete character sampling sequence samples better in the training process, and the summarization learning of the discrete sample sequences with low dimension is realized. Further, based on a decoding layer of the initial similarity determination model, carrying out data reconstruction processing on each data feature vector after dimension reduction to obtain a reconstructed data sequence, determining a compression loss value according to each discrete character sampling sequence sample and each data feature vector after dimension reduction in the training process, determining a reconstruction loss value according to the discrete character sampling sequence sample and the reconstructed data sequence, obtaining a trained similarity determination model when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition, and reducing error data in the model training process and improving the trained model precision by comprehensively considering training losses among different components, sampling sequence samples, intermediate results, reconstructed data sequences and the like in the model training process so as to improve the accuracy of a target object matched with search information when the subsequent similarity determination model searches for the candidate data sequence set based on the trained similarity.
In one embodiment, the dimension reduction processing module is further configured to: performing nonlinear transformation processing on each discrete character sampling sequence sample according to the nonlinear transformation layer to obtain sequence data characteristics corresponding to each discrete character sampling sequence sample; and based on the dimension reduction processing layer, carrying out dimension reduction processing on the data characteristics of each sequence according to the sequence square sum invariant processing logic to obtain each data characteristic vector after dimension reduction.
In one embodiment, the dimension reduction processing module is further configured to: performing feature coding processing on each discrete character sampling sequence sample to obtain initial data features; carrying out residual mapping processing on the initial data features according to each residual block in the multi-layer residual blocks to obtain residual mapping data, and superposing the residual mapping data and the initial data features to obtain intermediate data features; and carrying out normalization processing, nonlinear fitting processing and pooling processing on the intermediate data characteristics to obtain sequence data characteristics.
In one embodiment, the dimension reduction processing module is further configured to: through the full connection layer and the nonlinear activation layer, vector conversion processing and nonlinear conversion processing are carried out on the sequence data characteristics to obtain sequence characteristic vectors; and performing dimension reduction processing on each sequence feature vector according to the sequence square sum invariant processing logic based on the target normalization layer to obtain each data feature vector after dimension reduction.
In one embodiment, the dimension reduction processing module is further configured to: acquiring a preset square sum matrix corresponding to the sequence square sum invariant processing logic; determining row data and column data corresponding to each sequence of feature vectors based on a preset sum-of-squares matrix; determining the square sum corresponding to each sequence feature vector according to the row data and the column data corresponding to each sequence feature vector; and carrying out standardization processing on each sequence feature vector based on the target normalization layer, and carrying out sequence scaling and dimension reduction processing on the standardized sequence feature vector according to a sequence square sum invariant processing logic to obtain each data feature vector after dimension reduction.
In one embodiment, the data reconstruction processing module is further configured to: based on the initial similarity, determining a decoding layer of the model, and carrying out vector conversion processing and nonlinear transformation processing on the data feature vector after the dimension reduction to obtain a reconstructed data sequence feature vector; performing feature coding processing on the reconstructed data sequence feature vector to obtain initial reconstructed data sequence features; performing residual mapping processing and data feature superposition processing based on the initial reconstructed data sequence features to obtain intermediate reconstructed data features; performing normalization processing, nonlinear fitting processing and pooling processing on the intermediate reconstructed data characteristics to obtain reconstructed data sequence characteristics; and carrying out multi-layer linear processing and normalization processing based on the characteristics of the reconstructed data sequence to obtain the reconstructed data sequence.
In one embodiment, a similarity determination model processing apparatus is provided, further including a compression loss value determining module configured to: constructing and obtaining an original data sequence pair according to any two discrete character sampling sequence samples, and determining a first pairing distance between the original data sequence pairs; randomly constructing discrete data pairs based on the feature vectors of the data after dimension reduction, and determining a second pairing distance between the discrete data pairs; acquiring the sample number of the discrete character sampling sequence samples and the vector number of each data feature vector after dimension reduction; performing sequence scaling processing on the first pairing distance according to the number of samples to obtain a first scaling pairing distance, and performing sequence scaling processing on the second pairing distance according to the number of vectors to obtain a second scaling pairing distance; the number of sequence pairs of the original data sequence pairs is obtained, and a compression loss value is determined according to the number of sequence pairs, each first scaling pair distance and each second scaling pair distance.
In one embodiment, a similarity determination model processing apparatus is provided, further including a reconstruction loss value determination module configured to: randomly constructing a reconstructed data sequence pair based on each discrete character sampling sequence sample and the reconstructed data sequence; determining a third pairing distance between the pair of reconstructed data sequences; and determining a reconstruction loss value according to the number of samples of the discrete character sampling sequence samples and the third pairing distances.
In one embodiment, the similarity determination model obtaining module is further configured to: weighting the reconstruction loss according to the weight parameter corresponding to the reconstruction loss value to obtain a weighted reconstruction loss value; summing processing is carried out on the basis of the compression loss value and the weighted reconstruction loss value, so that a fusion loss value is obtained; if the fusion loss value reaches the preset loss threshold value corresponding to the model training ending condition, determining that the model training is ended, and determining the initial similarity determination model after the training is ended as a trained similarity determination model.
In one embodiment, the discrete character sampling sequence sample acquisition module is further configured to: acquiring a data sequence to be screened, and carrying out mean value discretization on the data sequence to be screened to obtain a discrete character sequence; determining character important bits of each discrete character in the discrete character sequence, and reordering each discrete character in the discrete character sequence according to the character important bits to obtain reordered character sequence; and performing data sampling based on the character sequence to obtain each discrete character sampling sequence sample.
In one embodiment, the discrete character sampling sequence sample acquisition module is further configured to: dividing a data sequence to be screened into a preset subsequence with the same length; determining the average value corresponding to each subsequence, and carrying out quantization processing on the average value corresponding to each subsequence to obtain a discrete character corresponding to each subsequence; and performing splicing and combining on the basis of each discrete character to obtain a discrete character sequence.
In one embodiment, the discrete character sampling sequence sample acquisition module is further configured to: determining character importance positions of each discrete character in the discrete character sequence according to the positions of each discrete character in the discrete character sequence; and reordering the discrete characters according to character importance bits of the discrete characters in a mode of decreasing the character importance bits to obtain reordered character sequences.
In one embodiment, as shown in fig. 17, there is provided a target object searching apparatus including: a search information acquisition module 1702, a candidate data sequence set acquisition module 1704, and a target object determination module 1706, wherein:
the search information obtaining module 1702 is configured to obtain, if a target object search request is detected, search information corresponding to the target object search request;
a candidate data sequence set acquisition module 1704, configured to acquire a candidate data sequence set;
the target object determining module 1706 is configured to perform depth discretization processing on each candidate data sequence in the candidate data sequence set according to the trained similarity determining model, obtain a depth discretized data sequence, perform similarity search based on the depth discretized data sequence, and determine a target object matched with the search information; the trained similarity determination model is obtained when the calculated fusion loss value meets the model training ending condition in the training process of the initial similarity determination model according to each discrete character sampling sequence sample; the fusion loss value is obtained by determining a compression loss value according to each discrete character sampling sequence sample and each data characteristic vector after dimension reduction and a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence; the data feature vectors after the dimension reduction are obtained by performing nonlinear transformation processing and dimension reduction processing on the discrete character sampling sequence samples according to an encoding layer of the initial similarity determination model, and the reconstructed data sequence is obtained by performing data reconstruction processing on the data feature vectors after the dimension reduction based on a decoding layer of the initial similarity determination model.
In the target object searching device, if the target object searching request is detected, the searching information corresponding to the target object searching request is acquired, the candidate data sequence set is acquired, the depth discretization processing is carried out on each candidate data sequence in the candidate data sequence set according to the trained similarity determination model, the depth discretization data sequence is obtained, the high-quality dimension reduction processing of each candidate data sequence is realized, the important characteristic information of each candidate data sequence is reserved, the similarity searching is carried out based on the depth discretization data sequence, the target object matched with the searching information is determined, and the accuracy of the target object matched with the searching information is improved when the similarity searching of the candidate data sequence set is carried out according to the trained similarity determination model.
In one embodiment, the target object determination module is further configured to: according to the coding layer, carrying out nonlinear transformation processing and dimension reduction processing on each candidate data sequence to obtain each candidate data feature vector after dimension reduction; based on the decoding layer, carrying out data reconstruction processing on each candidate data feature vector after dimension reduction to obtain a reconstructed candidate data sequence; performing depth discretization processing on each reconstruction candidate data sequence to obtain candidate discrete characters corresponding to each reconstruction candidate data sequence; determining character importance bits of each candidate discrete character, and reordering each candidate discrete character according to a mode that the character importance bits of each candidate discrete character are decreased, so as to obtain a depth discretization data sequence.
In one embodiment, the target object determination module is further configured to: constructing a data sequence discretization index according to each depth discretization data sequence; and carrying out similarity search based on the data sequence discretization index, and determining a target object matched with the search information.
The respective modules in the above-described similarity determination model processing means and the target object searching means may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 18. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing data such as a data sequence to be screened, each discrete character sampling sequence sample, each data characteristic vector after dimension reduction, a reconstructed data sequence, a compression loss value, a reconstruction loss value, a fusion loss value, a trained similarity determination model, search information corresponding to a target object search request, a candidate data sequence set, a depth discretization data sequence, a target object matched with the search information and the like. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a similarity determination model processing method, and a target object searching method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 18 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (15)

1. A similarity determination model processing method, the method comprising:
acquiring a sample sequence of each discrete character sample determined based on a data sequence to be screened;
determining a coding layer of a model according to the initial similarity, and performing nonlinear transformation processing and dimension reduction processing on each discrete character sampling sequence sample to obtain feature vectors of each data after dimension reduction;
Based on the decoding layer of the initial similarity determination model, carrying out data reconstruction processing on each data feature vector after dimension reduction to obtain a reconstructed data sequence;
in the training process, determining a compression loss value according to each discrete character sampling sequence sample and each data feature vector after dimension reduction, determining a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence, and obtaining a trained similarity determination model when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition.
2. The method of claim 1, wherein the encoding layer comprises a nonlinear transformation layer and a dimension reduction processing layer; the coding layer of the model is determined according to the initial similarity, nonlinear transformation processing and dimension reduction processing are carried out on each discrete character sampling sequence sample, and each data feature vector after dimension reduction is obtained, and the method comprises the following steps:
performing nonlinear transformation processing on each discrete character sampling sequence sample according to the nonlinear transformation layer to obtain sequence data characteristics corresponding to each discrete character sampling sequence sample;
And carrying out dimension reduction processing on the sequence data features according to a sequence square sum invariant processing logic based on the dimension reduction processing layer to obtain dimension reduced data feature vectors.
3. The method of claim 2, wherein the nonlinear transformation layer comprises a multi-layer residual block, each residual block comprising a superposition of multiple normalization layers, nonlinear activation layers, and convolution layers; the nonlinear transformation processing is performed on each discrete character sampling sequence sample according to the nonlinear transformation layer to obtain a sequence data characteristic corresponding to each discrete character sampling sequence sample, including:
performing feature coding processing on each discrete character sampling sequence sample to obtain initial data features;
performing residual mapping processing on the initial data features according to each residual block in the multi-layer residual blocks to obtain residual mapping data, and overlapping the residual mapping data and the initial data features to obtain intermediate data features;
and carrying out normalization processing, nonlinear fitting processing and pooling processing on the intermediate data characteristics to obtain sequence data characteristics.
4. The method of claim 2, wherein the dimension reduction processing layer comprises a plurality of fully connected layers, a nonlinear activation layer, and a target normalization layer; the dimension reduction processing layer is used for carrying out dimension reduction processing on the sequence data features according to a sequence square sum invariant processing logic to obtain dimension reduced data feature vectors, and the dimension reduced data feature vectors comprise:
performing vector conversion processing and nonlinear conversion processing on the sequence data characteristics through the full connection layer and the nonlinear activation layer to obtain sequence characteristic vectors;
and performing dimension reduction processing on each sequence feature vector according to a sequence square sum invariant processing logic based on the target normalization layer to obtain each data feature vector after dimension reduction.
5. The method of claim 4, wherein the performing, based on the target normalization layer, the dimension reduction processing on each of the sequence feature vectors according to the sequence square sum invariant processing logic to obtain dimension reduced data feature vectors, comprises:
acquiring a preset square sum matrix corresponding to the sequence square sum invariant processing logic;
determining row data and column data corresponding to each sequence feature vector based on the preset sum-of-squares matrix;
Determining a square sum corresponding to each sequence feature vector according to row data and column data corresponding to each sequence feature vector;
and carrying out standardization processing on each sequence feature vector based on the target normalization layer, and carrying out sequence scaling and dimension reduction processing on the standardized sequence feature vector according to a sequence square sum invariant processing logic to obtain each data feature vector after dimension reduction.
6. The method according to claim 1, wherein the performing, by the decoding layer of the initial similarity determination model, a data reconstruction process on each of the data feature vectors after the dimension reduction to obtain a reconstructed data sequence includes:
based on the decoding layer of the initial similarity determination model, carrying out vector conversion processing and nonlinear transformation processing on the data feature vector after the dimension reduction to obtain a reconstructed data sequence feature vector;
performing feature coding processing on the reconstructed data sequence feature vector to obtain initial reconstructed data sequence features;
performing residual mapping processing and data feature superposition processing based on the initial reconstructed data sequence features to obtain intermediate reconstructed data features;
carrying out normalization processing, nonlinear fitting processing and pooling processing on the intermediate reconstructed data characteristics to obtain reconstructed data sequence characteristics;
And carrying out multi-layer linear processing and normalization processing based on the characteristics of the reconstructed data sequence to obtain the reconstructed data sequence.
7. The method of any of claims 1 to 6, wherein determining a compression loss value from each of the discrete character sample sequence samples and each of the reduced-dimension data feature vectors comprises:
constructing and obtaining an original data sequence pair according to any two discrete character sampling sequence samples, and determining a first pairing distance between the original data sequence pairs;
randomly constructing discrete data pairs based on the data feature vectors after dimension reduction, and determining a second pairing distance between the discrete data pairs;
acquiring the sample number of the discrete character sampling sequence samples and the vector number of each data feature vector after dimension reduction;
performing sequence scaling processing on the first pairing distance according to the sample number to obtain a first scaling pairing distance, and performing sequence scaling processing on the second pairing distance according to the vector number to obtain a second scaling pairing distance;
and acquiring the number of sequence pairs of the original data sequence pairs, and determining a compression loss value according to the number of sequence pairs, each first scaling pair distance and each second scaling pair distance.
8. The method of any of claims 1 to 6, wherein determining a reconstruction loss value from the discrete character sample sequence samples and the reconstruction data sequence comprises:
randomly constructing a reconstruction data sequence pair based on each discrete character sampling sequence sample and the reconstruction data sequence;
determining a third pair-wise distance between the pair of reconstructed data sequences;
and determining a reconstruction loss value according to the sample number of the discrete character sampling sequence samples and the third pairing distance.
9. The method according to any one of claims 1 to 6, wherein obtaining a trained similarity determination model when a fusion loss value determined from the compression loss value and the reconstruction loss value satisfies a model training end condition, comprises:
weighting the reconstruction loss according to the weight parameter corresponding to the reconstruction loss value to obtain a weighted reconstruction loss value;
summing processing is carried out based on the compression loss value and the weighted reconstruction loss value, so as to obtain a fusion loss value;
and if the fusion loss value reaches the preset loss threshold value corresponding to the model training ending condition, determining that model training is ended, and determining an initial similarity determination model at the end of training as a trained similarity determination model.
10. The method according to any one of claims 1 to 6, wherein the obtaining samples of the sequence of discrete character samples determined based on the sequence of data to be screened comprises:
acquiring a data sequence to be screened, and carrying out mean value discretization on the data sequence to be screened to obtain a discrete character sequence;
determining character important bits of each discrete character in the discrete character sequence, and reordering each discrete character in the discrete character sequence according to the character important bits to obtain reordered character sequence;
and carrying out data sampling based on the character sequence to obtain each discrete character sampling sequence sample.
11. The method of claim 10, wherein performing a mean discretization process on the data sequence to be screened to obtain a discrete character sequence comprises:
dividing the data sequence to be screened into subsequences with the same preset length;
determining the average value corresponding to each subsequence, and carrying out quantization processing on the average value corresponding to each subsequence to obtain a discrete character corresponding to each subsequence;
and performing splicing and combining on the basis of each discrete character to obtain a discrete character sequence.
12. The method of claim 11, wherein determining the character significance of each discrete character in the sequence of discrete characters and reordering each discrete character in the sequence of discrete characters according to the character significance comprises:
determining character importance positions of the discrete characters in the discrete character sequence according to positions of the discrete characters in the discrete character sequence;
and reordering the discrete characters according to the character importance bits of the discrete characters in a mode of decreasing the character importance bits to obtain reordered character sequences.
13. A target object searching method, the method comprising:
if a target object search request is detected, acquiring search information corresponding to the target object search request;
acquiring a candidate data sequence set;
performing depth discretization processing on each candidate data sequence in the candidate data sequence set according to the trained similarity determination model to obtain a depth discretized data sequence, performing similarity search based on the depth discretized data sequence, and determining a target object matched with the search information;
The trained similarity determination model is obtained when the calculated fusion loss value meets the model training ending condition in the training process of the initial similarity determination model according to each discrete character sampling sequence sample; the fusion loss value is obtained by determining a compression loss value according to each discrete character sampling sequence sample and each data characteristic vector after dimension reduction and a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence; the data feature vectors after dimension reduction are obtained by performing nonlinear transformation processing and dimension reduction processing on the discrete character sampling sequence samples according to an encoding layer of an initial similarity determination model, and the reconstructed data sequence is obtained by performing data reconstruction processing on the data feature vectors after dimension reduction based on a decoding layer of the initial similarity determination model.
14. The method of claim 13, wherein the trained similarity determination model comprises an encoding layer and a decoding layer; performing depth discretization processing on each candidate data sequence in the candidate data sequence set according to the trained similarity determination model to obtain a depth discretized data sequence, wherein the method comprises the following steps:
According to the coding layer, carrying out nonlinear transformation processing and dimension reduction processing on each candidate data sequence to obtain each candidate data feature vector after dimension reduction;
based on the decoding layer, carrying out data reconstruction processing on each candidate data feature vector after dimension reduction to obtain a reconstructed candidate data sequence;
performing depth discretization processing on each reconstruction candidate data sequence to obtain candidate discrete characters corresponding to each reconstruction candidate data sequence;
determining character importance bits of the candidate discrete characters, and reordering the candidate discrete characters according to a mode that the character importance bits of the candidate discrete characters are decreased, so that a depth discretization data sequence is obtained.
15. A similarity determination model processing apparatus, the apparatus comprising:
the discrete character sampling sequence sample acquisition module is used for acquiring each discrete character sampling sequence sample determined based on the data sequence to be screened;
the dimension reduction processing module is used for determining a coding layer of the model according to the initial similarity, performing nonlinear transformation processing and dimension reduction processing on each discrete character sampling sequence sample, and obtaining each data feature vector after dimension reduction;
The data reconstruction processing module is used for determining a decoding layer of the model based on the initial similarity, and carrying out data reconstruction processing on each data feature vector after dimension reduction to obtain a reconstructed data sequence;
the similarity determination model obtaining module is used for determining a compression loss value according to each discrete character sampling sequence sample and each data feature vector after dimension reduction in the training process, determining a reconstruction loss value according to the discrete character sampling sequence sample and the reconstruction data sequence, and obtaining a trained similarity determination model when the fusion loss value determined according to the compression loss value and the reconstruction loss value meets the model training ending condition.
CN202310920749.7A 2023-07-24 2023-07-24 Similarity determination model processing method, target object searching method and device Pending CN116975651A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310920749.7A CN116975651A (en) 2023-07-24 2023-07-24 Similarity determination model processing method, target object searching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310920749.7A CN116975651A (en) 2023-07-24 2023-07-24 Similarity determination model processing method, target object searching method and device

Publications (1)

Publication Number Publication Date
CN116975651A true CN116975651A (en) 2023-10-31

Family

ID=88472487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310920749.7A Pending CN116975651A (en) 2023-07-24 2023-07-24 Similarity determination model processing method, target object searching method and device

Country Status (1)

Country Link
CN (1) CN116975651A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117807434A (en) * 2023-12-06 2024-04-02 中国信息通信研究院 Communication data set processing method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117807434A (en) * 2023-12-06 2024-04-02 中国信息通信研究院 Communication data set processing method and device

Similar Documents

Publication Publication Date Title
CN112035672A (en) Knowledge graph complementing method, device, equipment and storage medium
CN109902714B (en) Multi-modal medical image retrieval method based on multi-graph regularization depth hashing
CN113177141B (en) Multi-label video hash retrieval method and device based on semantic embedded soft similarity
CN115083435B (en) Audio data processing method and device, computer equipment and storage medium
CN110928961A (en) Multi-mode entity linking method, equipment and computer readable storage medium
CN111444715A (en) Entity relationship identification method and device, computer equipment and storage medium
CN111091010A (en) Similarity determination method, similarity determination device, network training device, network searching device and storage medium
CN116975651A (en) Similarity determination model processing method, target object searching method and device
CN116721221A (en) Multi-mode-based three-dimensional content generation method, device, equipment and storage medium
CN111210382A (en) Image processing method, image processing device, computer equipment and storage medium
CN111241298B (en) Information processing method, apparatus, and computer-readable storage medium
CN113408721A (en) Neural network structure searching method, apparatus, computer device and storage medium
CN116561272A (en) Open domain visual language question-answering method and device, electronic equipment and storage medium
WO2023168818A1 (en) Method and apparatus for determining similarity between video and text, electronic device, and storage medium
CN114661874B (en) Visual question-answering method based on multi-angle semantic understanding and self-adaptive double channels
CN117011219A (en) Method, apparatus, device, storage medium and program product for detecting quality of article
CN114741487A (en) Image-text retrieval method and system based on image-text semantic embedding
CN115994541B (en) Interface semantic data generation method, device, computer equipment and storage medium
CN116703531B (en) Article data processing method, apparatus, computer device and storage medium
CN117938951B (en) Information pushing method, device, computer equipment and storage medium
CN110929527B (en) Method and device for determining semantic similarity
CN116150462A (en) Vector construction method and device for target object and computer equipment
CN116630336A (en) Image segmentation, image segmentation model processing method and device and computer equipment
CN117036368A (en) Image data processing method, device, computer equipment and storage medium
CN117253164A (en) Video processing method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication