Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
b87d7ee
1
Parent(s):
10e436b
Create file to generate papers.md from YAML
Browse files- docs/generate_papers.py +69 -0
- docs/{papers.md → papers.yml} +20 -62
- docs/papers_header.md +34 -0
docs/generate_papers.py
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Read papers.yml and generate papers.md"""
|
2 |
+
|
3 |
+
# Here is an example papers.yml:
|
4 |
+
"""
|
5 |
+
papers:
|
6 |
+
- title: Machine Learning the Gravity Equation for International Trade
|
7 |
+
authors:
|
8 |
+
- Sergiy Verstyuk (1)
|
9 |
+
- Michael R. Douglas (1)
|
10 |
+
affiliations:
|
11 |
+
1: Harvard University
|
12 |
+
link: https://papers.ssrn.com/abstract=4053795
|
13 |
+
abstract: Machine learning (ML) is becoming more and more important throughout the mathematical and theoretical sciences. In this work we apply modern ML methods to gravity models of pairwise interactions in international economics. We explain the formulation of graphical neural networks (GNNs), models for graph-structured data that respect the properties of exchangeability and locality. GNNs are a natural and theoretically appealing class of models for international trade, which we demonstrate empirically by fitting them to a large panel of annual-frequency country-level data. We then use a symbolic regression algorithm to turn our fits into interpretable models with performance comparable to state of the art hand-crafted models motivated by economic theory. The resulting symbolic models contain objects resembling market access functions, which were developed in modern structural literature, but in our analysis arise ab initio without being explicitly postulated. Along the way, we also produce several model-consistent and model-agnostic ML-based measures of bilateral trade accessibility.
|
14 |
+
image: economic_theory_gravity.png
|
15 |
+
"""
|
16 |
+
|
17 |
+
# Corresponding example papers.md:
|
18 |
+
"""
|
19 |
+
<div class="row"><div class="image_column">
|
20 |
+
|
21 |
+
![](images/economic_theory_gravity.png)
|
22 |
+
|
23 |
+
</div><div class="text_column"><div class="center">
|
24 |
+
|
25 |
+
[Machine Learning the Gravity Equation for International Trade](https://papers.ssrn.com/abstract=4053795)<br>
|
26 |
+
Sergiy Verstyuk<sup>1</sup>, Michael R. Douglas.<sup>1</sup><br><sup>1</sup>Harvard University
|
27 |
+
|
28 |
+
</div>
|
29 |
+
|
30 |
+
**Abstract:** Machine learning (ML) is becoming more and more important throughout the mathematical and theoretical sciences. In this work we apply modern ML methods to gravity models of pairwise interactions in international economics. We explain the formulation of graphical neural networks (GNNs), models for graph-structured data that respect the properties of exchangeability and locality. GNNs are a natural and theoretically appealing class of models for international trade, which we demonstrate empirically by fitting them to a large panel of annual-frequency country-level data. We then use a symbolic regression algorithm to turn our fits into interpretable models with performance comparable to state of the art hand-crafted models motivated by economic theory. The resulting symbolic models contain objects resembling market access functions, which were developed in modern structural literature, but in our analysis arise ab initio without being explicitly postulated. Along the way, we also produce several model-consistent and model-agnostic ML-based measures of bilateral trade accessibility.
|
31 |
+
|
32 |
+
</div></div>
|
33 |
+
"""
|
34 |
+
|
35 |
+
import yaml
|
36 |
+
|
37 |
+
data_file = "papers.yml"
|
38 |
+
papers_header = "papers_header.md"
|
39 |
+
output_file = "papers.md"
|
40 |
+
|
41 |
+
# Load YAML file:
|
42 |
+
with open(data_file, "r") as stream:
|
43 |
+
papers = yaml.load(stream, Loader=yaml.SafeLoader)["papers"]
|
44 |
+
|
45 |
+
# Load header:
|
46 |
+
with open(papers_header, "r") as stream:
|
47 |
+
header = stream.read()
|
48 |
+
|
49 |
+
with open(output_file, "w") as f:
|
50 |
+
f.write(header)
|
51 |
+
|
52 |
+
for paper in papers:
|
53 |
+
title = paper["title"]
|
54 |
+
authors = (
|
55 |
+
", ".join(paper["authors"]).replace("(", "<sup>").replace(")", "</sup>")
|
56 |
+
)
|
57 |
+
affiliations = ", ".join(
|
58 |
+
f"<sup>{num}</sup>{affil}" for num, affil in paper["affiliations"].items()
|
59 |
+
)
|
60 |
+
link = paper["link"]
|
61 |
+
abstract = paper["abstract"]
|
62 |
+
image_file = paper["image"]
|
63 |
+
|
64 |
+
f.write("""<div class="row"><div class="image_column">\n\n""")
|
65 |
+
f.write(f"""![](images/{image_file})\n\n""")
|
66 |
+
f.write("""</div><div class="text_column"><div class="center">\n\n""")
|
67 |
+
f.write(f"""<a href="{link}">{title}</a><br>{authors}<br>{affiliations}<br>\n\n""")
|
68 |
+
f.write(f"""**Abstract:** {abstract}\n\n""")
|
69 |
+
f.write("""</div></div></div>\n\n""")
|
docs/{papers.md → papers.yml}
RENAMED
@@ -1,62 +1,20 @@
|
|
1 |
-
# PySR
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
**Abstract:** Machine learning (ML) is becoming more and more important throughout the mathematical and theoretical sciences. In this work we apply modern ML methods to gravity models of pairwise interactions in international economics. We explain the formulation of graphical neural networks (GNNs), models for graph-structured data that respect the properties of exchangeability and locality. GNNs are a natural and theoretically appealing class of models for international trade, which we demonstrate empirically by fitting them to a large panel of annual-frequency country-level data. We then use a symbolic regression algorithm to turn our fits into interpretable models with performance comparable to state of the art hand-crafted models motivated by economic theory. The resulting symbolic models contain objects resembling market access functions, which were developed in modern structural literature, but in our analysis arise ab initio without being explicitly postulated. Along the way, we also produce several model-consistent and model-agnostic ML-based measures of bilateral trade accessibility.
|
22 |
-
|
23 |
-
</div></div>
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
https://arxiv.org/abs/2109.10414v2 - particle physics paper, where they use PySR to discover new analytic formulae from one of the inference pipelines built for analyzing LHC (Large Hadron Collider) data.
|
28 |
-
|
29 |
-
https://doi.org/10.1007/JHEP06(2021)040 - high-energy physics paper, where they discover a formula for the "hyperbolic volume" of a "knot". This is a really interesting paper, although I note I'm not versed in high-energy physics so am unable to explain the specific problem.
|
30 |
-
|
31 |
-
https://arxiv.org/abs/2111.02422v1 - astrophysics paper, where they discover a better way for predicting galaxy properties using properties of the surrounding dark matter halo using PySR.
|
32 |
-
|
33 |
-
https://arxiv.org/abs/2109.04484v1 - astrophysics paper, where they use PySR to discover a more accurate model for the properties of dark matter subhalos in an interpretable way.
|
34 |
-
|
35 |
-
https://arxiv.org/abs/2012.00111 - astrophysics paper, where they use PySR to model assembly bias, and recover a new interpretable model for doing so.
|
36 |
-
|
37 |
-
<style>
|
38 |
-
.row {
|
39 |
-
display: flex;
|
40 |
-
}
|
41 |
-
.row:after {
|
42 |
-
content: "";
|
43 |
-
display: table;
|
44 |
-
clear: both;
|
45 |
-
}
|
46 |
-
.image_column {
|
47 |
-
flex: 25%;
|
48 |
-
float: left;
|
49 |
-
padding: 10px;
|
50 |
-
display: flex;
|
51 |
-
justify-content: center;
|
52 |
-
align-items: center;
|
53 |
-
text-align: center;
|
54 |
-
}
|
55 |
-
.text_column {
|
56 |
-
flex: 65%;
|
57 |
-
padding: 10px;
|
58 |
-
}
|
59 |
-
.center {
|
60 |
-
text-align: center;
|
61 |
-
}
|
62 |
-
</style>
|
|
|
1 |
+
# This file stores papers which have used PySR, with
|
2 |
+
# information to generate the "Research Showcase"
|
3 |
+
|
4 |
+
papers:
|
5 |
+
- title: Machine Learning the Gravity Equation for International Trade
|
6 |
+
authors:
|
7 |
+
- Sergiy Verstyuk (1)
|
8 |
+
- Michael R. Douglas (1)
|
9 |
+
affiliations:
|
10 |
+
1: Harvard University
|
11 |
+
link: https://papers.ssrn.com/abstract=4053795
|
12 |
+
abstract: Machine learning (ML) is becoming more and more important throughout the mathematical and theoretical sciences. In this work we apply modern ML methods to gravity models of pairwise interactions in international economics. We explain the formulation of graphical neural networks (GNNs), models for graph-structured data that respect the properties of exchangeability and locality. GNNs are a natural and theoretically appealing class of models for international trade, which we demonstrate empirically by fitting them to a large panel of annual-frequency country-level data. We then use a symbolic regression algorithm to turn our fits into interpretable models with performance comparable to state of the art hand-crafted models motivated by economic theory. The resulting symbolic models contain objects resembling market access functions, which were developed in modern structural literature, but in our analysis arise ab initio without being explicitly postulated. Along the way, we also produce several model-consistent and model-agnostic ML-based measures of bilateral trade accessibility.
|
13 |
+
image: economic_theory_gravity.png
|
14 |
+
|
15 |
+
# To add:
|
16 |
+
# https://arxiv.org/abs/2109.10414v2 - particle physics paper, where they use PySR to discover new analytic formulae from one of the inference pipelines built for analyzing LHC (Large Hadron Collider) data.
|
17 |
+
# https://doi.org/10.1007/JHEP06(2021)040 - high-energy physics paper, where they discover a formula for the "hyperbolic volume" of a "knot". This is a really interesting paper, although I note I'm not versed in high-energy physics so am unable to explain the specific problem.
|
18 |
+
# https://arxiv.org/abs/2111.02422v1 - astrophysics paper, where they discover a better way for predicting galaxy properties using properties of the surrounding dark matter halo using PySR.
|
19 |
+
# https://arxiv.org/abs/2109.04484v1 - astrophysics paper, where they use PySR to discover a more accurate model for the properties of dark matter subhalos in an interpretable way.
|
20 |
+
# https://arxiv.org/abs/2012.00111 - astrophysics paper, where they use PySR to model assembly bias, and recover a new interpretable model for doing so.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/papers_header.md
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# PySR Showcase
|
2 |
+
Below is a showcase of papers which have used PySR to discover
|
3 |
+
or rediscover a symbolic model.
|
4 |
+
|
5 |
+
If you have used PySR in your research,
|
6 |
+
please submit a pull request to add your paper to [this file](https://github.com/MilesCranmer/PySR/blob/master/docs/papers.md).
|
7 |
+
|
8 |
+
|
9 |
+
<style>
|
10 |
+
.row {
|
11 |
+
display: flex;
|
12 |
+
}
|
13 |
+
.row:after {
|
14 |
+
content: "";
|
15 |
+
display: table;
|
16 |
+
clear: both;
|
17 |
+
}
|
18 |
+
.image_column {
|
19 |
+
flex: 25%;
|
20 |
+
float: left;
|
21 |
+
padding: 10px;
|
22 |
+
display: flex;
|
23 |
+
justify-content: center;
|
24 |
+
align-items: center;
|
25 |
+
text-align: center;
|
26 |
+
}
|
27 |
+
.text_column {
|
28 |
+
flex: 65%;
|
29 |
+
padding: 10px;
|
30 |
+
}
|
31 |
+
.center {
|
32 |
+
text-align: center;
|
33 |
+
}
|
34 |
+
</style>
|