Type inference over partial contexts in dynamically typed languages is challenging. In this work, we present a graph neural network model that predicts types by probabilistically reasoning over a program's structure, names, and patterns. The network uses deep similarity learning to learn a TypeSpacea continuous relaxation of the discrete space of types-and how to embed the type properties of a symbol (i.e. identifier) into it. Importantly, our model can employ one-shot learning to predict an open vocabulary of types, including rare and user-defined ones. We realise our approach in Typilus for Python that combines the TypeSpace with an optional type checker. We show that Typilus accurately predicts types. Typilus confidently predicts types for 70% of all annotatable symbols; when it predicts a type, that type optionally type checks 95% of the time. Typilus can also find incorrect type annotations; two important and popular open source libraries, fairseq and allennlp, accepted our pull requests that fixed the annotation errors Typilus discovered. CCS Concepts: • Computing methodologies → Machine learning; • Software and its engineering → Language features.
Background Representation learning provides new and powerful graph analytical approaches and tools for the highly valued data science challenge of mining knowledge graphs. Since previous graph analytical methods have mostly focused on homogeneous graphs, an important current challenge is extending this methodology for richly heterogeneous graphs and knowledge domains. The biomedical sciences are such a domain, reflecting the complexity of biology, with entities such as genes, proteins, drugs, diseases, and phenotypes, and relationships such as gene co-expression, biochemical regulation, and biomolecular inhibition or activation. Therefore, the semantics of edges and nodes are critical for representation learning and knowledge discovery in real world biomedical problems. Results In this paper, we propose the edge2vec model, which represents graphs considering edge semantics. An edge-type transition matrix is trained by an Expectation-Maximization approach, and a stochastic gradient descent model is employed to learn node embedding on a heterogeneous graph via the trained transition matrix. edge2vec is validated on three biomedical domain tasks: biomedical entity classification, compound-gene bioactivity prediction, and biomedical information retrieval. Results show that by considering edge-types into node embedding learning in heterogeneous graphs, edge2vec significantly outperforms state-of-the-art models on all three tasks. Conclusions We propose this method for its added value relative to existing graph analytical methodology, and in the real world context of biomedical knowledge discovery applicability.
JavaScript is growing explosively and is now used in large mature projects even outside the web domain. JavaScript is also a dynamically typed language for which static type systems, notably Facebook's Flow and Microsoft's TypeScript, have been written. What benefits do these static type systems provide? Leveraging JavaScript project histories, we select a fixed bug and check out the code just prior to the fix. We manually add type annotations to the buggy code and test whether Flow and TypeScript report an error on the buggy code, thereby possibly prompting a developer to fix the bug before its public release. We then report the proportion of bugs on which these type systems reported an error. Evaluating static type systems against public bugs, which have survived testing and review, is conservative: it understates their effectiveness at detecting bugs during private development, not to mention their other benefits such as facilitating code search/completion and serving as documentation. Despite this uneven playing field, our central finding is that both static type systems find an important percentage of public bugs: both Flow 0.30 and TypeScript 2.0 successfully detect 15%!
Desorption hysteresis is important for primary gas production. Temperature may cause serious changes in the methane adsorption/ desorption behaviors. In order to study the mechanism of methane desorption and desorption hysteresis, three sets of samples of long-flame coal, coking coal, and anthracite were collected, and experiments such as microscopic composition determination, liquid nitrogen adsorption, and isothermal adsorption/desorption were performed. From the perspectives of desorption kinetics, desorption thermodynamics, and methane occurrence state, the differences in methane and methane desorption characteristics and the desorption hysteresis mechanism are discussed. The results show that at the same temperature, anthracite (SH3#) has the largest saturated adsorption capacity and residual adsorption capacity, followed by coking coal (SGZ11#), and long-flame coal (DFS4#) has the smallest. As the temperature increases, the theoretical desorption rate and residual adsorption capacity of anthracite (SH3#) and coking coal (SGZ11#) will increase first and then decrease. Temperature and methane desorption do have positive effects, but temperature may have a threshold for promoting methane desorption. It is necessary to comprehensively consider the influence of temperature on the activation of gas molecules and the pore structure of coal. Under the premise of a certain temperature, as the pressure increases, the desorption hysteresis rate changes in a logarithmic downward trend, the methane desorption hysteresis rate in the low-pressure stage (P < 4 MPa) is large, and the methane desorption hysteresis rate in the highpressure stage (P > 4 MPa) is lower; during the isobaric adsorption process, the adsorption capacity of anthracite (SH3#) increases the fastest, followed by SGZ11#, and that of DFS4# is the smallest. In the low-pressure stage (P < 4 MPa), the adsorption capacity increases significantly with the increase in pressure, but in the high-pressure stage (P > 4 MPa), the adsorption capacity does not change significantly with pressure, instead gradually stabilizes. Under the same pressure, the molecular free path of methane increases with temperature. Under the premise of constant temperature, in the low-pressure stage (0 < P < 4 MPa), when the pressure continues to decrease, the free path of methane molecules increases significantly, resulting in a decrease in diffusion capacity. In the high-pressure stage (4 < P < 8 MPa), when the pressure continues to decrease, the free path of methane molecules does not change significantly; the sample desorption process of three sets of samples DFS4#, SGZ11#, and SH3# occurs, and the intermediate adsorption heat is greater than the isometric adsorption heat during the adsorption process, indicating that the desorption process needs to continuously absorb heat from outside the system. The energy difference produced in the process of adsorption and desorption causes the desorption hysteresis effect. The greater the difference in the isometric heat value of adsorption, the...
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
hi@scite.ai
334 Leonard St
Brooklyn, NY 11211
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.