Skip to content

Commit

Permalink
add website
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhue committed Feb 16, 2024
1 parent 6607949 commit dc633ef
Show file tree
Hide file tree
Showing 22 changed files with 503 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
strategy:
matrix:
python:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
Expand All @@ -20,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Install torch
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches:
- main

permissions:
contents: read

jobs:
# Build the documentation and upload the static HTML files as an artifact.
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Build website
run: python docs/make.py
- uses: actions/upload-pages-artifact@v3
with:
path: docs/

deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

* The code is auto-formatted using `black .`.
* Static type checks can be run using `pyright`.
* Tests can be run using `pytest tests`.
* Tests can be run using `pytest test`.

### Documentation

Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
index.html
Empty file added docs/.nojekyll
Empty file.
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jonhue.github.io
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Build Instructions

Run `make.py` to build `index.html` and `./docs`.
8 changes: 8 additions & 0 deletions docs/demo1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from afsl import ActiveDataLoader, GradientEmebeddings

emb = GradientEmebeddings()
train_loader = ActiveDataLoader(emb, dataset, task, batch_size=32)

while not converged:
data = train_loader.next(model)
model.step(data)
6 changes: 6 additions & 0 deletions docs/demo2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from afsl import ActiveDataLoader, GradientEmebeddings

emb = GradientEmebeddings()
context_loader = ActiveDataLoader(emb, dataset, task, batch_size=5)
data = context_loader.next(model)
model.add_to_context(data)
305 changes: 305 additions & 0 deletions docs/index.html.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,305 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="afsl retrieves data intelligently to maximize the information gain about a downstream task. This can be used, for example, to select data for efficient few-shot fine-tuning or to populate a context for in-context learning.">
<meta property="og:title" content="Active Few-Shot Learning">
<meta property="og:type" content="website">
<meta property="og:url" content="https://jonhue.github.io/afsl">
<title>Active Few-Shot Learning</title>
{% autoescape false %}{% filter replace("\n","") | replace(" ","") | replace("<s","\n <s") %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "afsl",
"operatingSystem": "Python 3",
"applicationCategory": "DeveloperApplication",
"sameAs": [
"https://github.com/jonhue/afsl",
"https://pypi.org/project/afsl/"
],
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"review": {
"@type": "Review",
"reviewRating": {
"@type": "Rating",
"ratingValue": "5"
},
"author": {
"@type": "Person",
"name": "Maximilian Hils",
"sameAs": "https://hi.ls/"
},
"reviewBody": "A lightweight alternative to Sphinx!"
},
"url": "https://jonhue.github.io/afsl"
}
</script>
<style>{% include 'resources/bootstrap.min.css' %}</style>
<style>/* pygments */{{ pygments_css }}</style>
<style>
:root {
--color1: #2b50aa;
--color2: #F2545B;
--color3: #E8C547;
--color4: #419D78;
}
body {
font-size: 1.25rem;
}
h1 {
font-size: 2.75rem;
}
{% set boxwidth = 800 %}
{% set boxpad = 20 %}
{% set minw = boxwidth * 2 + boxpad * 4 %}
@media (min-width: {{ minw }}px) {
#example > input, #example > label {
display: none;
}
}
@media (max-width: {{ minw - 1 }}px) {
#example-code, #example-render {
display: none;
}
#view-code:checked ~ #example-code {
display: block;
}
#view-render:checked ~ #example-render {
display: block;
}
}
#example > label {
margin-bottom: 1rem;
}
#example > label[for=view-code] {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
#example > label[for=view-render] {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
#example-invocation code {
font-size: 1.2em;
display: inline-block;
border: solid var(--bs-dark) 1px;
background-color: rgba(255, 255, 255, 0.8);
color: var(--bs-gray-dark);
border-radius: 3px;
padding: 3px 7px;
margin-bottom: 32px;
}
#example-render, #example-code {
width: {{ boxwidth }}px;
max-width: 98vw;
margin: 0 {{ boxpad }}px;
flex: 0 0 auto;
box-shadow: rgba(0, 0, 0, 0.2) 0 20px 68px;
border-radius: 5px;
}
.example-code {
background-color: var(--bs-dark) !important;
position: relative;
overflow: auto;
}
.example-code svg {
position: absolute;
left: 20px;
top: 20px;
}
.example-code .title {
color: white;
min-height: 1em;
margin-top: 20px;
text-align: center;
}
.example-code .highlight {
margin: 20px;
margin-bottom: 30px;
}
.example-code pre {
overflow: inherit;
}
#install {
text-overflow: ellipsis;
}
#actions {
& > :nth-child(1) {
background-color: var(--color1);
border-color: var(--color1);
}
& > :nth-child(2) {
background-color: var(--color4);
border-color: var(--color4);
}
& > :nth-child(3) {
background-color: var(--color2);
border-color: var(--color2);
}
}
.highlighted {
color: rgb(119, 148, 244);
font-style: italic;
}
</style>
{% endfilter %}{% endautoescape %}
</head>
{%- macro icon(name) -%}
{% autoescape false %}
{% filter replace('<svg ', '<svg aria-hidden="true" ') %}
{% include "resources/" + name + ".svg" %}
{% endfilter %}
{% endautoescape %}
{%- endmacro %}
<body class="my-4">
<header class="container text-center my-4 py-4">
<div class="row justify-content-center mb-1 mt-4">
<h1>Active Few-Shot Learning</h1>
</div>
<div class="row justify-content-center mb-2">
<div class="col-md-7">
<p>
Efficient fine-tuning & in-context learning by intelligent active data selection.
</p>
</div>
</div>
</header>
<aside id="example" class="d-flex align-items-stretch justify-content-center flex-wrap">
<input type="radio" class="btn-check" name="view-selector" id="view-code" autocomplete="off" checked>
<label class="btn btn-outline-dark" for="view-code">Fine-tuning</label>
<input type="radio" class="btn-check" name="view-selector" id="view-render" autocomplete="off">
<label class="btn btn-outline-dark" for="view-render">In-context learning</label>
<div class="col-12"></div>
<div class="example-code" id="example-code">
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14">
<g>
<circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle>
<circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle>
<circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle>
</g>
</svg>
<div class="title"></div>
{{ example_html1 }}
</div>
<div class="example-code" id="example-render">
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14">
<g>
<circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle>
<circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle>
<circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle>
</g>
</svg>
<div class="title"></div>
{{ example_html2 }}
</div>
</aside>
<main class="container text-center my-4 py-4">
<div class="container text-center" id="actions">
<a href="https://github.com/jonhue/active-few-shot-learning"
itemprop="sameAs"
class="btn btn-lg btn-dark shadow mb-4 d-inline-flex align-items-center">
{{ icon("github") }}
&nbsp;GitHub
</a>
<a href="docs/afsl.html" class="btn btn-lg btn-dark shadow mb-4 d-inline-flex align-items-center">
{{ icon("book-half") }}
&nbsp;Documentation
</a>
<a href="https://github.com/jonhue/afsl/blob/main/CHANGELOG.md"
class="btn btn-lg btn-dark shadow mb-4 d-inline-flex align-items-center">
{{ icon("newspaper") }}
&nbsp;Paper
</a>
<div class="d-md-none"></div>
{# <a href="https://pypi.org/project/afsl/"
itemprop="sameAs"
class="btn btn-lg btn-warning shadow mb-4 d-inline-flex align-items-center">
{{ icon("box-seam") }}
&nbsp;PyPI
</a> #}
</div>
<div class="row justify-content-center mb-4">
<div class="col-md-7" style="max-width: 40rem; text-align: justify; hyphens: auto;">
<p>
<code>afsl</code> retrieves data intelligently to maximize the information gain about a downstream task.
This can be used, for example, to select data for efficient few-shot <i>fine-tuning</i> or to populate a context for <i>in-context learning</i>.
To learn more about how <code>afsl</code> works, check out our <a href="https://yas.pub">paper</a> or our <a href="https://yas.pub">blog post</a>.
</p>
</div>
</div>
{# <div class="container text-center my-4">
<h3>Installation</h3>
<div class="d-inline-block" style="max-width: 25rem; width: 100%;">
<div class="input-group input-group-lg shadow" onclick="getElementById('install').select()">
<label for="install" class="input-group-text" aria-label="install instructions">
{{ icon("terminal-fill") }}
</label>
<input id="install" type="text" class="form-control bg-white" value="pip install active-few-shot-learning" readonly>
</div>
</div>
<div class="mb-3 text-muted">Latest Release: {{ __version__ }}</div>
</div> #}
<div class="container justify-content-center my-4" style="max-width: 40rem; text-align: justify; hyphens: auto;">
<h3>Publications</h3>
{# <div class="list-group"> #}
<div class="mt-4">
<h5 class="mb-1">Active Few-Shot Fine-Tuning</h5>
<p class="mb-1" style="font-size: 0.8em;">Jonas Hübotter, Bhavya Sukhija, Lenart Treven, Yarden As, Andreas Krause</p>
<p style="font-size: 0.8em;">Preprint</p>
</div>
<div>
<h5 class="mb-1">Information-based Transductive Active Learning</h5>
<p class="mb-1" style="font-size: 0.8em;">Jonas Hübotter, Bhavya Sukhija, Lenart Treven, Yarden As, Andreas Krause</p>
<p style="font-size: 0.8em;">Preprint</p>
</div>
{# <div class="list-group-item my-2">
<h5 class="mb-1">Title: Advances in Quantum Computing</h5>
<p class="mb-1">Authors: Albert Einstein, Niels Bohr</p>
<small>Year: 2020, Venue: Proceedings of the National Academy of Sciences</small>
</div>
<div class="list-group-item my-2">
<h5 class="mb-1">Title: Exploring the Universe: Dark Matter and Dark Energy</h5>
<p class="mb-1">Authors: Carl Sagan, Vera Rubin</p>
<small>Year: 2019, Venue: Journal of Cosmology and Astroparticle Physics</small>
</div> #}
{# </div> #}
</div>
</main>
<footer class="d-none d-md-block">
<div class="text-center">
Authors: <a href="https://jonhue.github.io">Jonas Hübotter</a>, <a href="https://sukhijab.github.io">Bhavya Sukhija</a>, <a href="https://lenarttreven.github.io">Lenart Treven</a>, <a href="https://yas.pub">Yarden As</a>, and <a href="https://las.inf.ethz.ch/krausea">Andreas Krause</a>
</div>

{% include "resources/_github-button.html" %}
</footer>
</body>
</html>
Loading

0 comments on commit dc633ef

Please sign in to comment.