{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/transformer-for-partial-differential","title":"Transformer for Partial Differential Equations' Operator Learning","arxiv_id":"2205.13671","date":"2022-05-26","proceeding":null,"authors":["Zijie Li","Kazem Meidani","Amir Barati Farimani"],"abstract":"Data-driven learning of partial differential equations' solution operators has recently emerged as a promising paradigm for approximating the underlying solutions. The solution operators are usually parameterized by deep learning models that are built upon problem-specific inductive biases. An example is a convolutional or a graph neural network that exploits the local grid structure where functions' values are sampled. The attention mechanism, on the other hand, provides a flexible way to implicitly exploit the patterns within inputs, and furthermore, relationship between arbitrary query locations and inputs. In this work, we present an attention-based framework for data-driven operator learning, which we term Operator Transformer (OFormer). Our framework is built upon self-attention, cross-attention, and a set of point-wise multilayer perceptrons (MLPs), and thus it makes few assumptions on the sampling pattern of the input function or query locations. We show that the proposed framework is competitive on standard benchmark problems and can flexibly be adapted to randomly sampled input.","url_abs":"https://arxiv.org/abs/2205.13671v3","url_pdf":"https://arxiv.org/pdf/2205.13671v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"transformer-for-partial-differential","repo_url":"https://github.com/BaratiLab/OFormer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"graph-neural-network","task_name":"Graph Neural Network"},{"task_slug":"operator-learning","task_name":"Operator learning"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"graph-neural-network","method_name":"Graph Neural Network"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2205.13671","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2205.13671"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/BaratiLab/OFormer","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_violates":1,"unverified":12},"by_repo_kind":{"official":{"samples":13,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"6ba8cee9f5daea41","entry":"pair","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/nn_module/attention_module.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/nn_module/attention_module.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6ba8cee9f5daea41"}},{"code_sha256_prefix":"d2a267488e5f88c6","entry":"UpBlock","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/nn_module/cnn_module.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/nn_module/cnn_module.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d2a267488e5f88c6"}},{"code_sha256_prefix":"98e289ae1b56d7c0","entry":"get_arguments","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/utils.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"98e289ae1b56d7c0"}},{"code_sha256_prefix":"f5fe7cf07e8709cf","entry":"get_position_noise","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/dataset_new.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/dataset_new.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f5fe7cf07e8709cf"}},{"code_sha256_prefix":"1791daaf2f59716e","entry":"load_checkpoint","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/utils.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1791daaf2f59716e"}},{"code_sha256_prefix":"db49774e7606facb","entry":"masked_instance_norm","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/nn_module/attention_module.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/nn_module/attention_module.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"db49774e7606facb"}},{"code_sha256_prefix":"4762fef4996d2a13","entry":"mse_loss","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/train_magneto.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/train_magneto.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4762fef4996d2a13"}},{"code_sha256_prefix":"f8cb243cc1a0f36f","entry":"pointwise_rel_l2norm_loss","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/loss_fn.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/loss_fn.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f8cb243cc1a0f36f"}},{"code_sha256_prefix":"5a7532a28e562c44","entry":"pointwise_rel_loss","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/train_magneto.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/train_magneto.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5a7532a28e562c44"}},{"code_sha256_prefix":"21fed1f814c62fc4","entry":"rel_l2norm_loss","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/loss_fn.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/loss_fn.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"21fed1f814c62fc4"}},{"code_sha256_prefix":"4ea01e43ff3bade1","entry":"rel_loss","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/loss_fn.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/loss_fn.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4ea01e43ff3bade1"}},{"code_sha256_prefix":"5fa6d15f0e91f394","entry":"rotate_half","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/nn_module/attention_module.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/nn_module/attention_module.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5fa6d15f0e91f394"}},{"code_sha256_prefix":"123b1d815aab7261","entry":"unroll_sequence","repo":"BaratiLab/OFormer","repo_kind":"official","path":"BVP/train_magneto.py","file_url":"https://github.com/BaratiLab/OFormer/blob/HEAD/BVP/train_magneto.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"123b1d815aab7261"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}