Skip to content

Commit

Permalink
Create pdf figures
Browse files Browse the repository at this point in the history
  • Loading branch information
phschiele committed Dec 13, 2023
1 parent cf87b96 commit f557d5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions experiments.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from pathlib import Path

from experiments.taming import main as taming_main
from experiments.scaling_small import main as scaling_small_main

if __name__ == "__main__":
Path("checkpoints").mkdir(exist_ok=True)
scaling_small_main()
taming_main()
12 changes: 9 additions & 3 deletions experiments/scaling_small.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
from matplotlib import pyplot as plt
import cvxpy as cp
import numpy as np
from backtest import BacktestResult, OptimizationInput, Timing, load_data, run_backtest
from experiments.backtest import (
BacktestResult,
OptimizationInput,
Timing,
load_data,
run_backtest,
)
from experiments.utils import get_solver


Expand Down Expand Up @@ -205,11 +211,11 @@ def plot_timings(timings: list[Timing], specifier: str = "") -> None:

plt.ylabel("Time (s)")
plt.legend()
plt.savefig(f"figures/timing{specifier}.png")
plt.savefig(f"figures/timing{specifier}.pdf")
plt.show()


def main(from_checkpoint: bool = True) -> None:
def main(from_checkpoint: bool = False) -> None:
annualized_target = 0.10
sigma_target = annualized_target / np.sqrt(252)

Expand Down

0 comments on commit f557d5e

Please sign in to comment.