Deep patch feature prediction for image inpainting
US-2019295227-A1 · Sep 26, 2019 · US
US11238306B2 · US · B2
| Field | Value |
|---|---|
| Publication number | US-11238306-B2 |
| Application number | US-201816143701-A |
| Country | US |
| Kind code | B2 |
| Filing date | Sep 27, 2018 |
| Priority date | Sep 27, 2018 |
| Publication date | Feb 1, 2022 |
| Grant date | Feb 1, 2022 |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
Official abstract text for this publication.
A method, system and computer program product for obtaining vector representations of code snippets capturing semantic similarity. A first and second training set of code snippets are collected, where the first training set of code snippets implements the same function representing semantic similarity and the second training set of code snippets implements a different function representing semantic dissimilarity. A vector representation of a first and second code snippet from either the first or second training set of code snippets is generated using a machine learning model. A loss value is generated utilizing a loss function that is proportional or inverse to the distance between the first and second vectors in response to receiving the first and second code snippets from the first or second training set of code snippets, respectively. The machine learning model is trained to capture the semantic similarity in the code snippets by minimizing the loss value.
Opening claim text (preview).
The invention claimed is: 1. A method for obtaining vector representations of code snippets capturing semantic similarity, the method comprising: collecting a first training set of code snippets which implement a same function representing semantic similarity; collecting a second training set of code snippets which implement a different function representing semantic dissimilarity; generating a vector representation of a first code snippet and a second code snippet by utilizing a machine learning model, wherein said first and second code snippets are from one of said first and second training sets of code snippets, wherein said machine learning model outputs a first vector and a second vector based on said first and second code snippets; generating a loss value utilizing a loss function that is proportional to a distance between said first and second vectors in response to receiving said first and second code snippets from said first training set of code snippets; generating a loss value utilizing said loss function that is inverse to said distance between said first and second vectors in response to receiving said first and second code snippets from said second training set of code snippets; and training said machine learning model to generate vector representations of code snippets capturing semantic similarity between said code snippets by minimizing said loss value. 2. The method as recited in claim 1 further comprising: receiving a new set of code snippets; and generating vector representations of said new set of code snippets capturing semantic similarity between said new set of code snippets using said trained machine learning model. 3. The method as recited in claim 2 , wherein said new set of code snippets comprises a third code snippet and a fourth code snippet, where said vector representations of said new set of code snippets comprise a third vector and a fourth vector, wherein a distance between said third and fourth vectors represents a degree of semantic similarity between said third and fourth code snippets. 4. The method as recited in claim 1 , wherein said first or second training sets of code snippets are obtained via programming competitions or by synthesizing code. 5. The method as recited in claim 1 , wherein said distance comprises one of the following distances: angular, Euclidean, and Manhattan. 6. The method as recited in claim 1 , wherein said first and second vectors correspond to a real-valued vector of n dimensions, where n is a positive number. 7. The method as recited in claim 1 , wherein said first training set of code snippets implements said same function for a subset of input parameters. 8. A computer program product for obtaining vector representations of code snippets capturing semantic similarity, the computer program product comprising a computer readable storage medium having program code embodied therewith, the program code comprising the programming instructions for: collecting a first training set of code snippets which implement a same function representing semantic similarity; collecting a second training set of code snippets which implement a different function representing semantic dissimilarity; generating a vector representation of a first code snippet and a second code snippet by utilizing a machine learning model, wherein said first and second code snippets are from one of said first and second training sets of code snippets, wherein said machine learning model outputs a first vector and a second vector based on said first and second code snippets; generating a loss value utilizing a loss function that is proportional to a distance between said first and second vectors in response to receiving said first and second code snippets from said first training set of code snippets; generating a loss value utilizing said loss function that is inverse to said distance between said first and second vectors in response to receiving said first and second code snippets from said second training set of code snippets; and training said machine learning model to generate vector representations of code snippets capturing semantic similarity between said code snippets by minimizing said loss value. 9. The computer program product as recited in claim 8 , wherein the program code further comprises the programming instructions for: receiving a new set of code snippets; and generating vector representations of said new set of code snippets capturing semantic similarity between said new set of code snippets using said trained machine learning model. 10. The computer program product as recited in claim 9 , wherein said new set of code snippets comprises a third code snippet and a fourth code snippet, where said vector representations of said new set of code snippets comprise a third vector and a fourth vector, wherein a distance between said third and fourth vectors represents a degree of semantic similarity between said third and fourth code snippets. 11. The computer program product as recited in claim 8 , wherein said first or second training sets of code snippets are obtained via programming competitions or by synthesizing code. 12. The computer program product as recited in claim 8 , wherein said distance comprises one of the following distances: angular, Euclidean, and Manhattan. 13. The computer program product as recited in claim 8 , wherein said first and second vectors correspond to a real-valued vector of n dimensions, where n is a positive number. 14. The computer program product as recited in claim 8 , wherein said first training set of code snippets implements said same function for a subset of input parameters. 15. A system, comprising: a memory for storing a computer program for obtaining vector representations of code snippets capturing semantic similarity; and a processor connected to said memory, wherein said processor is configured to execute the program instructions of the computer program comprising: collecting a first training set of code snippets which implement a same function representing semantic similarity; collecting a second training set of code snippets which implement a different function representing semantic dissimilarity; generating a vector representation of a first code snippet and a second code snippet by utilizing a machine learning model, wherein said first and second code snippets are from one of said first and second training sets of code snippets, wherein said machine learning model outputs a first vector and a second vector based on said first and second code snippets; generating a loss value utilizing a loss function that is proportional to a distance between said first and second vectors in response to receiving said first and second code snippets from said first training set of code snippets; generating a loss value utilizing said loss function that is inverse to said distance between said first and second vectors in response to receiving said first and second code snippets from said second training set of code snippets; and training said machine learning model to generate vector representations of code snippets capturing semantic similarity between said code snippets by minimizing said loss value. 16. The system as recited in claim 15 , wherein the program instructions of the computer program further comprise: receiving a new set of code snippets; and generating vector representations of said new set of code snippets capturing semantic similarity between said new set of code snippets using said trained machine learning model. 17. The system as recited in claim 16 , wherein
Matching criteria, e.g. proximity measures · CPC title
Semantic analysis · CPC title
Generating training patterns; Bootstrap methods, e.g. bagging or boosting · CPC title
Supervised learning · CPC title
Learning methods · CPC title
Related publications grouped by family.
Answers are generated from the same data shown on this page.