Updated thesis

This commit is contained in:
2024-04-25 14:08:43 +02:00
parent c7bcd5be55
commit 361414cd41
7 changed files with 127 additions and 105 deletions

View File

@@ -140,7 +140,7 @@ The MAE and MSE metrics do not compare the distribution of the NRV to the real N
The mean CRPS can be calculated over the different days to get a single value. The lower this value, the better the NRV is modeled. The CRPS metric can be visualized as shown in figure \ref{fig:crps_visualization}. The CRPS is the area between the predicted cumulative distribution function and the Heavyside function. The lower the area between the curves, the better the NRV is modeled.
TODO: improve visualisation?
TODO: improve visualisation? -> echte NRV + y as cummulative prob
\begin{figure}[H]
\centering
\includegraphics[width=0.8\textwidth]{images/quantile_regression/crps_visualization.png}

View File

@@ -1,4 +1,4 @@
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex 2023.9.17) 24 APR 2024 21:49
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex 2023.9.17) 25 APR 2024 12:04
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
@@ -851,45 +851,45 @@ Package csquotes Info: Checking for multilingual support...
Package csquotes Info: ... found 'babel' package.
Package csquotes Info: Adjusting default style.
Package csquotes Info: Redefining alias 'default' -> 'english'.
LaTeX Font Info: Trying to load font information for T1+LinuxLibertineT-TLF on input line 108.
LaTeX Font Info: Trying to load font information for T1+LinuxLibertineT-TLF on input line 127.
(/usr/local/texlive/2023/texmf-dist/tex/latex/libertine/T1LinuxLibertineT-TLF.fd
File: T1LinuxLibertineT-TLF.fd 2017/03/20 (autoinst) Font definitions for T1/LinuxLibertineT-TLF.
)
LaTeX Font Info: Font shape `T1/LinuxLibertineT-TLF/m/n' will be
(Font) scaled to size 12.0pt on input line 108.
(Font) scaled to size 12.0pt on input line 127.
(./verslag.aux (./sections/introduction.aux) (./sections/background.aux) (./sections/literature_study.aux))
\openout1 = `verslag.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 108.
LaTeX Font Info: ... okay on input line 108.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 108.
LaTeX Font Info: ... okay on input line 108.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 108.
LaTeX Font Info: ... okay on input line 108.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 108.
LaTeX Font Info: ... okay on input line 108.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 108.
LaTeX Font Info: ... okay on input line 108.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 108.
LaTeX Font Info: ... okay on input line 108.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 108.
LaTeX Font Info: ... okay on input line 108.
LaTeX Font Info: Checking defaults for LS1/libertinust1math/m/n on input line 108.
LaTeX Font Info: Trying to load font information for LS1+libertinust1math on input line 108.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 127.
LaTeX Font Info: ... okay on input line 127.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 127.
LaTeX Font Info: ... okay on input line 127.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 127.
LaTeX Font Info: ... okay on input line 127.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 127.
LaTeX Font Info: ... okay on input line 127.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 127.
LaTeX Font Info: ... okay on input line 127.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 127.
LaTeX Font Info: ... okay on input line 127.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 127.
LaTeX Font Info: ... okay on input line 127.
LaTeX Font Info: Checking defaults for LS1/libertinust1math/m/n on input line 127.
LaTeX Font Info: Trying to load font information for LS1+libertinust1math on input line 127.
(/usr/local/texlive/2023/texmf-dist/tex/latex/libertinust1math/ls1libertinust1math.fd
File: ls1libertinust1math.fd 2016/03/23 Fontinst v1.933 font definitions for LS1/libertinust1math.
)
LaTeX Font Info: ... okay on input line 108.
LaTeX Font Info: Checking defaults for LS2/libertinust1mathsym/m/n on input line 108.
LaTeX Font Info: Trying to load font information for LS2+libertinust1mathsym on input line 108.
LaTeX Font Info: ... okay on input line 127.
LaTeX Font Info: Checking defaults for LS2/libertinust1mathsym/m/n on input line 127.
LaTeX Font Info: Trying to load font information for LS2+libertinust1mathsym on input line 127.
(/usr/local/texlive/2023/texmf-dist/tex/latex/libertinust1math/ls2libertinust1mathsym.fd
File: ls2libertinust1mathsym.fd 2015/04/17 v1.1.2-latex LibertinusT1Mathsym LS2 font definitions
)
LaTeX Font Info: ... okay on input line 108.
LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 108.
LaTeX Font Info: ... okay on input line 108.
LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 108.
LaTeX Font Info: ... okay on input line 108.
LaTeX Font Info: ... okay on input line 127.
LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 127.
LaTeX Font Info: ... okay on input line 127.
LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 127.
LaTeX Font Info: ... okay on input line 127.
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
@@ -946,8 +946,8 @@ File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
))
\c@mv@tabular=\count458
\c@mv@boldtabular=\count459
LaTeX Info: Command `\dddot' is already robust on input line 108.
LaTeX Info: Command `\ddddot' is already robust on input line 108.
LaTeX Info: Command `\dddot' is already robust on input line 127.
LaTeX Info: Command `\ddddot' is already robust on input line 127.
Package caption Info: Begin \AtBeginDocument code.
Package caption Info: hyperref package is loaded.
Package caption Info: End \AtBeginDocument code.
@@ -981,9 +981,9 @@ Package biblatex Info: Automatic encoding selection.
Package biblatex Info: Trying to load bibliographic data...
Package biblatex Info: ... file 'verslag.bbl' found.
(./verslag.bbl)
Package biblatex Info: Reference section=0 on input line 108.
Package biblatex Info: Reference segment=0 on input line 108.
Package hyperref Info: Link coloring ON on input line 108.
Package biblatex Info: Reference section=0 on input line 127.
Package biblatex Info: Reference segment=0 on input line 127.
Package hyperref Info: Link coloring ON on input line 127.
(./verslag.out) (./verslag.out)
\@outlinefile=\write4
\openout4 = `verslag.out'.
@@ -1020,85 +1020,85 @@ Package hyperref Info: Link coloring ON on input line 108.
* \@reversemarginfalse
* (1in=72.27pt=25.4mm, 1cm=28.453pt)
LaTeX Font Info: Trying to load font information for T1+LinuxBiolinumT-TLF on input line 116.
LaTeX Font Info: Trying to load font information for T1+LinuxBiolinumT-TLF on input line 135.
(/usr/local/texlive/2023/texmf-dist/tex/latex/libertine/T1LinuxBiolinumT-TLF.fd
File: T1LinuxBiolinumT-TLF.fd 2017/03/20 (autoinst) Font definitions for T1/LinuxBiolinumT-TLF.
)
LaTeX Font Info: Font shape `T1/LinuxBiolinumT-TLF/m/n' will be
(Font) scaled to size 12.0pt on input line 116.
(Font) scaled to size 12.0pt on input line 135.
pdfTeX warning: pdflatex (file ./ea-en.pdf): PDF inclusion: found PDF version <1.7>, but at most version <1.5> allowed
<ea-en.pdf, id=92, 192.05753pt x 64.01918pt>
File: ea-en.pdf Graphic file (type pdf)
<use ea-en.pdf>
Package pdftex.def Info: ea-en.pdf used on input line 116.
Package pdftex.def Info: ea-en.pdf used on input line 135.
(pdftex.def) Requested size: 271.63632pt x 90.54071pt.
LaTeX Font Info: Font shape `T1/LinuxBiolinumT-TLF/b/n' will be
(Font) scaled to size 12.0pt on input line 116.
(Font) scaled to size 12.0pt on input line 135.
LaTeX Font Info: Font shape `T1/LinuxBiolinumT-TLF/b/n' will be
(Font) scaled to size 24.88pt on input line 116.
(Font) scaled to size 24.88pt on input line 135.
LaTeX Font Info: Font shape `T1/LinuxBiolinumT-TLF/b/n' will be
(Font) scaled to size 17.28pt on input line 116.
(Font) scaled to size 17.28pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/m/n' will be
(Font) scaled to size 12.0pt on input line 116.
(Font) scaled to size 12.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/m/n' will be
(Font) scaled to size 8.0pt on input line 116.
(Font) scaled to size 8.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/m/n' will be
(Font) scaled to size 6.0pt on input line 116.
(Font) scaled to size 6.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/m/it' will be
(Font) scaled to size 12.0pt on input line 116.
(Font) scaled to size 12.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/m/it' will be
(Font) scaled to size 8.0pt on input line 116.
(Font) scaled to size 8.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/m/it' will be
(Font) scaled to size 6.0pt on input line 116.
(Font) scaled to size 6.0pt on input line 135.
LaTeX Font Info: Font shape `LS2/libertinust1mathsym/m/n' will be
(Font) scaled to size 12.0pt on input line 116.
(Font) scaled to size 12.0pt on input line 135.
LaTeX Font Info: Font shape `LS2/libertinust1mathsym/m/n' will be
(Font) scaled to size 8.0pt on input line 116.
(Font) scaled to size 8.0pt on input line 135.
LaTeX Font Info: Font shape `LS2/libertinust1mathsym/m/n' will be
(Font) scaled to size 6.0pt on input line 116.
LaTeX Font Info: Trying to load font information for LS2+libertinust1mathex on input line 116.
(Font) scaled to size 6.0pt on input line 135.
LaTeX Font Info: Trying to load font information for LS2+libertinust1mathex on input line 135.
(/usr/local/texlive/2023/texmf-dist/tex/latex/libertinust1math/ls2libertinust1mathex.fd
File: ls2libertinust1mathex.fd 2016/03/15 v1.0.0-latex LibertinusMath extensions LS2 font definitions
)
LaTeX Font Info: Font shape `LS2/libertinust1mathex/m/n' will be
(Font) scaled to size 12.0pt on input line 116.
(Font) scaled to size 12.0pt on input line 135.
LaTeX Font Info: Font shape `LS2/libertinust1mathex/m/n' will be
(Font) scaled to size 8.0pt on input line 116.
(Font) scaled to size 8.0pt on input line 135.
LaTeX Font Info: Font shape `LS2/libertinust1mathex/m/n' will be
(Font) scaled to size 6.0pt on input line 116.
LaTeX Font Info: Trying to load font information for LS1+libertinust1mathbb on input line 116.
(Font) scaled to size 6.0pt on input line 135.
LaTeX Font Info: Trying to load font information for LS1+libertinust1mathbb on input line 135.
(/usr/local/texlive/2023/texmf-dist/tex/latex/libertinust1math/ls1libertinust1mathbb.fd
File: ls1libertinust1mathbb.fd 2016/08/22 latex LibertinusT1Mathbb LS1 font definitions
)
LaTeX Font Info: Font shape `LS1/libertinust1mathbb/m/n' will be
(Font) scaled to size 12.0pt on input line 116.
(Font) scaled to size 12.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1mathbb/m/n' will be
(Font) scaled to size 8.0pt on input line 116.
(Font) scaled to size 8.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1mathbb/m/n' will be
(Font) scaled to size 6.0pt on input line 116.
(Font) scaled to size 6.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/b/n' will be
(Font) scaled to size 12.0pt on input line 116.
(Font) scaled to size 12.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/b/n' will be
(Font) scaled to size 8.0pt on input line 116.
(Font) scaled to size 8.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/b/n' will be
(Font) scaled to size 6.0pt on input line 116.
(Font) scaled to size 6.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/b/it' will be
(Font) scaled to size 12.0pt on input line 116.
(Font) scaled to size 12.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/b/it' will be
(Font) scaled to size 8.0pt on input line 116.
(Font) scaled to size 8.0pt on input line 135.
LaTeX Font Info: Font shape `LS1/libertinust1math/b/it' will be
(Font) scaled to size 6.0pt on input line 116.
(Font) scaled to size 6.0pt on input line 135.
LaTeX Font Info: Font shape `T1/LinuxBiolinumT-TLF/b/n' will be
(Font) scaled to size 14.4pt on input line 116.
(Font) scaled to size 14.4pt on input line 135.
Underfull \hbox (badness 10000) in paragraph at lines 116--116
Underfull \hbox (badness 10000) in paragraph at lines 135--135
[]
Overfull \hbox (33.0pt too wide) in paragraph at lines 116--116
Overfull \hbox (33.0pt too wide) in paragraph at lines 135--135
[][][][][][][][]
[]
@@ -1108,14 +1108,14 @@ pdfTeX warning: pdflatex (file ./ugent-en.pdf): PDF inclusion: found PDF version
<ugent-en.pdf, id=93, 106.69862pt x 85.3589pt>
File: ugent-en.pdf Graphic file (type pdf)
<use ugent-en.pdf>
Package pdftex.def Info: ugent-en.pdf used on input line 116.
Package pdftex.def Info: ugent-en.pdf used on input line 135.
(pdftex.def) Requested size: 150.91232pt x 120.72095pt.
[1
{/usr/local/texlive/2023/texmf-var/fonts/map/pdftex/updmap/pdftex.map}{/usr/local/texlive/2023/texmf-dist/fonts/enc/dvips/libertine/lbtn_25tcsq.enc} <./ea-en.pdf> <./ugent-en.pdf>]
LaTeX Font Info: Font shape `T1/LinuxBiolinumT-TLF/m/n' will be
(Font) scaled to size 17.28pt on input line 123.
(Font) scaled to size 17.28pt on input line 142.
(./verslag.toc
LaTeX Font Info: Font shape `T1/LinuxLibertineT-TLF/b/n' will be
(Font) scaled to size 12.0pt on input line 2.
@@ -1127,7 +1127,7 @@ LaTeX Font Info: Font shape `T1/LinuxLibertineT-TLF/b/n' will be
pdfTeX warning (ext4): destination with the same identifier (name{page.1}) has been already used, duplicate ignored
<to be read again>
\relax
l.124 \newpage
l.143 \newpage
[1
{/usr/local/texlive/2023/texmf-dist/fonts/enc/dvips/libertine/lbtn_nh77jq.enc}{/usr/local/texlive/2023/texmf-dist/fonts/enc/dvips/libertine/lbtn_76gpa5.enc}]
@@ -1570,7 +1570,7 @@ Here is how much of TeX's memory you used:
1141 hyphenation exceptions out of 8191
83i,16n,131p,1405b,5180s stack positions out of 10000i,1000n,20000p,200000b,200000s
</Users/victormylle/Library/texlive/2023/texmf-var/fonts/pk/ljfour/public/bbm/bbm12.600pk></usr/local/texlive/2023/texmf-dist/fonts/type1/public/libertinust1math/LibertinusT1Math.pfb></usr/local/texlive/2023/texmf-dist/fonts/type1/public/libertine/LinBiolinumT.pfb></usr/local/texlive/2023/texmf-dist/fonts/type1/public/libertine/LinBiolinumTB.pfb></usr/local/texlive/2023/texmf-dist/fonts/type1/public/libertine/LinLibertineT.pfb></usr/local/texlive/2023/texmf-dist/fonts/type1/public/libertine/LinLibertineTB.pfb></usr/local/texlive/2023/texmf-dist/fonts/type1/public/libertine/LinLibertineTI.pfb></usr/local/texlive/2023/texmf-dist/fonts/type1/public/stix/stix-mathcal.pfb>
Output written on verslag.pdf (29 pages, 4068911 bytes).
Output written on verslag.pdf (29 pages, 4068943 bytes).
PDF statistics:
425 PDF objects out of 1000 (max. 8388607)
322 compressed objects within 4 object streams

Binary file not shown.

Binary file not shown.

View File

@@ -29,7 +29,26 @@
\usepackage{subcaption}
\usepackage{booktabs}
% Electricity market
% Generative Modeling
% -> Quantile Regression
% -> Autoregressive vs non autoregressive
% -> Modellen (linear, non linear, gru)
% -> Diffusion (1 grote)
% Policies (globaal, hoe winst maken) Wij heel simpele, tonen dat NRV generaties nut hebben. Reinforcement learning voor complexere
% -> Baseline Policies
% -> Policies based on generations (NRV is nu full day samples)
% Waarom nuttig om toekomst te modellen
% Results & discussion
% -> Per model resultaten
% -> Comparison between models
% Conclusion
% plot mean and std for averaged NRV over all days
% Autoregressive models krijgen enkels voorspelde waardes voor dat kwartier, waarom niet van kwartieren erna ook? Uitleg: voor laatste kwartier van de dag, voorspelling van de dag erna nodig. Anders extra padding.
% Non autoregressive vs autoregressive. Autoregressive weet niet dat hij T+1 ... T+96 moet voorspellen. Denkt dat hij enkel T+1 voorspelt. Te overconfident in voorspellingen voor input met error.
\newcolumntype{C}{>{\centering\arraybackslash}X}
@@ -158,6 +177,7 @@
\include{sections/literature_study}
% In introduction
\section{TODO: Better title for this section}
This thesis can be divided into two main parts. The first part focuses on modeling the Net Regulation Volume (NRV) of the Belgian electricity market for the next day. This modeling is conditioned on multiple inputs that can be obtained from Elia (TODO: add citation to the open data of Elia). The second part of the thesis focuses on optimizing a simple policy using the NRV generations for the next day. The policy tries to maximize profit by charging and discharging a battery and thereby buying and selling electricity on the market. Multiple models are trained and tested to model the NRV and compared to each other based on their profit optimization.

View File

@@ -242,30 +242,31 @@ class DiffusionTrainer:
_, generated_sampels = self.test(test_loader, -1, task)
# self.policy_evaluator.plot_profits_table()
if self.policy_evaluator:
optimal_penalty, profit, charge_cycles = (
self.policy_evaluator.optimize_penalty_for_target_charge_cycles(
idx_samples=generated_sampels,
test_loader=test_loader,
initial_penalty=900,
target_charge_cycles=283,
initial_learning_rate=1,
max_iterations=50,
tolerance=1,
optimal_penalty, profit, charge_cycles = (
self.policy_evaluator.optimize_penalty_for_target_charge_cycles(
idx_samples=generated_sampels,
test_loader=test_loader,
initial_penalty=900,
target_charge_cycles=283,
initial_learning_rate=1,
max_iterations=50,
tolerance=1,
)
)
)
print(
f"Optimal Penalty: {optimal_penalty}, Profit: {profit}, Charge Cycles: {charge_cycles}"
)
print(
f"Optimal Penalty: {optimal_penalty}, Profit: {profit}, Charge Cycles: {charge_cycles}"
)
task.get_logger().report_single_value(
name="Optimal Penalty", value=optimal_penalty
)
task.get_logger().report_single_value(name="Optimal Profit", value=profit)
task.get_logger().report_single_value(
name="Optimal Charge Cycles", value=charge_cycles
)
task.get_logger().report_single_value(
name="Optimal Penalty", value=optimal_penalty
)
task.get_logger().report_single_value(name="Optimal Profit", value=profit)
task.get_logger().report_single_value(
name="Optimal Charge Cycles", value=charge_cycles
)
if task:
task.close()
@@ -436,13 +437,13 @@ class DiffusionTrainer:
inversed_samples_batched - inversed_expanded_targets
)
inversed_mae_mean = inversed_mae.mean()
all_inversed_mae.extend(inversed_mae_mean.tolist())
all_inversed_mae.append(inversed_mae_mean)
inversed_mse = np.square(
inversed_samples_batched - inversed_expanded_targets
)
inversed_mse_mean = inversed_mse.mean()
all_inversed_mse.extend(inversed_mse_mean.tolist())
all_inversed_mse.append(inversed_mse_mean)
# add all values from crps_mean to all_crps
all_crps.extend(crps_mean.tolist())
@@ -460,12 +461,12 @@ class DiffusionTrainer:
mean_inversed_mae = np.array(all_inversed_mae).mean()
task.get_logger().report_single_value(
name="test_MSELoss", value=mean_inversed_mae
name="test_L1Loss", value=mean_inversed_mae
)
mean_inversed_mse = np.array(all_inversed_mse).mean()
task.get_logger().report_single_value(
name="test_L1Loss", value=mean_inversed_mse
name="test_MSELoss", value=mean_inversed_mse
)
if self.best_score is None or mean_crps < self.best_score:

View File

@@ -2,7 +2,7 @@ from src.utils.clearml import ClearMLHelper
clearml_helper = ClearMLHelper(project_name="Thesis/NrvForecast")
task = clearml_helper.get_task(
task_name="Diffusion Training: hidden_sizes=[256, 256], lr=0.0001, time_dim=8"
task_name="Diffusion Training: hidden_sizes=[256, 256], lr=0.0001, time_dim=8 + Load + PV + Wind + NP"
)
task.execute_remotely(queue_name="default", exit_process=True)
@@ -19,16 +19,19 @@ from src.policies.PolicyEvaluator import PolicyEvaluator
data_config = DataConfig()
data_config.NRV_HISTORY = True
data_config.LOAD_HISTORY = False
data_config.LOAD_FORECAST = False
data_config.LOAD_HISTORY = True
data_config.LOAD_FORECAST = True
data_config.WIND_FORECAST = False
data_config.WIND_HISTORY = False
data_config.PV_FORECAST = True
data_config.PV_HISTORY = True
data_config.QUARTER = False
data_config.DAY_OF_WEEK = False
data_config.WIND_FORECAST = True
data_config.WIND_HISTORY = True
data_config.NOMINAL_NET_POSITION = False
data_config.QUARTER = True
data_config.DAY_OF_WEEK = True
data_config.NOMINAL_NET_POSITION = True
data_config = task.connect(data_config, name="data_features")
@@ -42,7 +45,7 @@ print("Input dim: ", inputDim)
model_parameters = {
"epochs": 15000,
"learning_rate": 0.0001,
"hidden_sizes": [256, 256],
"hidden_sizes": [256, 256, 256],
"time_dim": 8,
}
@@ -70,7 +73,5 @@ baseline_policy = BaselinePolicy(battery, data_path="")
policy_evaluator = PolicyEvaluator(baseline_policy, task)
#### Trainer ####
trainer = DiffusionTrainer(
model, data_processor, "cuda", policy_evaluator=policy_evaluator
)
trainer = DiffusionTrainer(model, data_processor, "cuda", policy_evaluator=None)
trainer.train(model_parameters["epochs"], model_parameters["learning_rate"], task)