Skip to content

Commit 4d84c9c

Browse files
committed
2 parents ed11657 + b5e13c5 commit 4d84c9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3808
-979
lines changed

.github/workflows/wheels.yml

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,28 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
# on: [push, pull_request]
4+
on:
5+
push:
6+
paths-ignore:
7+
- .gitignore
8+
- README.md
9+
- LICENSE
10+
- doc/
411

512
jobs:
613
build_wheels:
714
name: Build wheels on ${{ matrix.os }}
815
runs-on: ${{ matrix.os }}
916
strategy:
1017
matrix:
11-
os: [ubuntu-20.04, windows-2019]
18+
os: [ubuntu-latest, windows-latest]
1219

1320
steps:
14-
# Install poetry
1521
- uses: actions/checkout@v4
16-
- name: Install poetry
17-
run: pipx install poetry
18-
19-
# Used to host poetry
20-
- uses: actions/setup-python@v3
21-
- name: Lock and install dependencies
22-
run: |
23-
poetry lock
24-
poetry install
25-
26-
- name: Build and build sdist package
27-
run: |
28-
poetry run python setup.py build
29-
poetry run python setup.py sdist
30-
31-
- name: Build wheel package
32-
run: poetry run python setup.py bdist_wheel
33-
34-
- name: Build wheels for more general OS
35-
run: poetry build --format=wheel
3622

23+
- uses: pypa/cibuildwheel@v2.16
24+
3725
- uses: actions/upload-artifact@v4
3826
with:
3927
name: rehline-wheels-${{ matrix.os }}-${{ strategy.job-index }}
40-
path: ./dist
28+
path: ./wheelhouse/*.whl

.gitignore

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,17 @@ eigen3.zip
2020

2121
# Package sdist
2222
*.tar.gz
23-
*.whl
23+
*.whl
24+
25+
.vscode/*
26+
!.vscode/settings.json
27+
!.vscode/tasks.json
28+
!.vscode/launch.json
29+
!.vscode/extensions.json
30+
!.vscode/*.code-snippets
31+
32+
# Local History for Visual Studio Code
33+
.history/
34+
35+
# Built Visual Studio Code Extensions
36+
*.vsix

.ipynb_checkpoints/FairSVM-checkpoint.ipynb

Lines changed: 223 additions & 0 deletions
Large diffs are not rendered by default.

.ipynb_checkpoints/QR-checkpoint.ipynb

Lines changed: 123 additions & 0 deletions
Large diffs are not rendered by default.

.ipynb_checkpoints/SVM-checkpoint.ipynb

Lines changed: 110 additions & 0 deletions
Large diffs are not rendered by default.

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
{
2-
"esbonio.sphinx.confDir": ""
2+
"esbonio.sphinx.confDir": "",
3+
"files.associations": {
4+
"random": "cpp",
5+
"type_traits": "cpp",
6+
"tuple": "cpp",
7+
"utility": "cpp"
8+
}
39
}

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cmake_minimum_required(VERSION 3.0)
2+
project(rehline LANGUAGES CXX)
3+
4+
set(PYBIND11_FINDPYTHON ON)
5+
find_package(pybind11 CONFIG REQUIRED)
6+
7+
pybind11_add_module(rehline MODULE src/rehline.cpp)
8+
9+
install(TARGETS rehline DESTINATION .)

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
# ReHLine <a href="https://github.com/softmin/ReHLine"><img src="doc/source/logo.png" align="right" height="138" /></a>
1+
# ReHLine <a href="https://github.com/softmin/ReHLine"><img src="doc/source/figs/logo.png" align="right" height="138" /></a>
22

33
**ReHLine** is designed to be a computationally efficient and practically useful software package for large-scale empirical risk minimization (ERM) problems.
44

5-
- GitHub repo: [https://github.com/softmin/ReHLine-python](https://github.com/softmin/ReHLine-python)
65
- Documentation: [https://rehline-python.readthedocs.io](https://rehline-python.readthedocs.io)
6+
- Project homepage: [https://rehline.github.io](https://rehline.github.io)
7+
- GitHub repo: [https://github.com/softmin/ReHLine-python](https://github.com/softmin/ReHLine-python)
78
- PyPi: [https://pypi.org/project/rehline](https://pypi.org/project/rehline)
8-
- Open Source: [MIT license](https://opensource.org/licenses/MIT)
99
- Paper: [NeurIPS | 2023](https://openreview.net/pdf?id=3pEBW2UPAD)
10+
<!-- - Open Source: [MIT license](https://opensource.org/licenses/MIT) -->
11+
1012

1113
The **ReHLine** solver has four appealing
1214
"linear properties":
@@ -16,6 +18,7 @@ The **ReHLine** solver has four appealing
1618
- The optimization algorithm has a provable linear convergence rate.
1719
- The per-iteration computational complexity is linear in the sample size.
1820

21+
<!--
1922
## 📝 Formulation
2023
2124
**ReHLine** is designed to address the empirical regularized ReLU-ReHU minimization problem, named *ReHLine optimization*, of the following form:
@@ -38,7 +41,7 @@ $$
3841
3942
This formulation has a wide range of applications spanning various fields, including statistics, machine learning, computational biology, and social studies. Some popular examples include SVMs with fairness constraints (FairSVM), elastic net regularized quantile regression (ElasticQR), and ridge regularized Huber minimization (RidgeHuber).
4043
41-
![](./figs/tab.png)
44+
![](./figs/tab.png) -->
4245

4346
## ⌛ Benchmark (powered by benchopt)
4447

build.py

Lines changed: 0 additions & 85 deletions
This file was deleted.
Binary file not shown.

doc/_templates/autoapi/index.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

doc/requirements.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

doc/source/README.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

doc/source/_static/css/label.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.summarylabel {
2+
background-color: var(--color-foreground-secondary);
3+
color: var(--color-background-secondary);
4+
font-size: 70%;
5+
padding-left: 2px;
6+
padding-right: 2px;
7+
border-radius: 3px;
8+
vertical-align: 15%;
9+
padding-bottom: 2px;
10+
filter: opacity(40%);
11+
}
12+
13+
14+
table.summarytable {
15+
width: 100%;
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
API Reference
2+
=============
3+
4+
This page contains auto-generated API reference documentation.
5+
6+
.. toctree::
7+
:titlesonly:
8+
9+
{% for page in pages %}
10+
{{ page.include_path }}
11+
{% endfor %}
12+
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{# AutoApiSummary replacement macro #}
2+
{#
3+
The intent of this macro is to replace the autoapisummary directive with the following
4+
improvements:
5+
1) Method signature is generated without typing annotation regardless of the value of
6+
`autodoc_typehints`
7+
2) Properties are treated like attribute (but labelled as properties).
8+
3) Label are added as summary prefix to indicate if the member is a property, class
9+
method, or static method.
10+
11+
Copyright: Antoine Beyeler, 2022
12+
License: MIT
13+
#}
14+
15+
{# Renders an object's name with a proper reference and optional signature.
16+
17+
The signature is re-generated from obj.obj.args, which is undocumented but is the
18+
only way to have a type-less signature if `autodoc_typehints` is `signature` or
19+
`both`. #}
20+
{% macro _render_item_name(obj, sig=False) -%}
21+
:py:obj:`{{ obj.name }} <{{ obj.id }}>`
22+
{%- if sig -%}
23+
\ (
24+
{%- for arg in obj.obj.args -%}
25+
{%- if arg[0] %}{{ arg[0]|replace('*', '\*') }}{% endif -%}{{ arg[1] -}}
26+
{%- if not loop.last %}, {% endif -%}
27+
{%- endfor -%}
28+
){%- endif -%}
29+
{%- endmacro %}
30+
31+
32+
{# Generates a single object optionally with a signature and a labe. #}
33+
{% macro _item(obj, sig=False, label='') %}
34+
* - {{ _render_item_name(obj, sig) }}
35+
- {% if label %}:summarylabel:`{{ label }}` {% endif %}{% if obj.summary %}{{ obj.summary }}{% else %}\-{% endif +%}
36+
{% endmacro %}
37+
38+
39+
40+
{# Generate an autosummary-like table with the provided members. #}
41+
{% macro auto_summary(objs, title='') -%}
42+
43+
.. list-table:: {{ title }}
44+
:header-rows: 0
45+
:widths: auto
46+
:class: summarytable {#- apply CSS class to customize styling +#}
47+
48+
{% for obj in objs -%}
49+
{#- should the full signature be used? -#}
50+
{%- set sig = (obj.type in ['method', 'function'] and not 'property' in obj.properties) -%}
51+
52+
{#- compute label -#}
53+
{%- if 'property' in obj.properties -%}
54+
{%- set label = 'prop' -%}
55+
{%- elif 'classmethod' in obj.properties -%}
56+
{%- set label = 'class' -%}
57+
{%- elif 'abstractmethod' in obj.properties -%}
58+
{%- set label = 'abc' -%}
59+
{%- elif 'staticmethod' in obj.properties -%}
60+
{%- set label = 'static' -%}
61+
{%- else -%}
62+
{%- set label = '' -%}
63+
{%- endif -%}
64+
65+
{{- _item(obj, sig=sig, label=label) -}}
66+
{%- endfor -%}
67+
68+
{% endmacro %}

0 commit comments

Comments
 (0)