Skip to content

Commit 98476da

Browse files
committed
OTWO-ELM version 2
1 parent c418129 commit 98476da

File tree

2 files changed

+29
-65
lines changed

2 files changed

+29
-65
lines changed

project_note.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@
1515

1616
# Project structure
1717
1. General view class
18-
![Our model](paper/images/code/all_code_wrapper.png)
18+
![Our model](drafts/images/code/all_code_wrapper.png)
1919

2020
2. Details view class
2121
* root files
2222

23-
![](paper/images/code/root_ann.png) ![](paper/images/code/root_rnn.png) ![](paper/images/code/root_hybrid_mlnn.png)
23+
![](drafts/images/code/root_ann.png) ![](drafts/images/code/root_rnn.png) ![](drafts/images/code/root_hybrid_mlnn.png)
2424

2525
* algorithm files
2626

27-
![](paper/images/code/GA.png) ![](paper/images/code/DE.png) ![](paper/images/code/PSO.png)
27+
![](drafts/images/code/GA.png) ![](drafts/images/code/DE.png) ![](drafts/images/code/PSO.png)
2828

29-
![](paper/images/code/CRO.png) ![](paper/images/code/BFO.png)
29+
![](drafts/images/code/CRO.png) ![](drafts/images/code/BFO.png)
3030

3131
* main files
3232

33-
![Our model](paper/images/code/hybrid_mlnn.png)
33+
![Our model](drafts/images/code/hybrid_mlnn.png)
3434

35-
![Our model](paper/images/code/neural_network.png)
35+
![Our model](drafts/images/code/neural_network.png)
3636

3737

3838

readme.md

+23-59
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,32 @@
11
# A Novel Workload Prediction Model Using ELM with Opposition-based Tug of War Optimization
2+
[![GitHub release](https://img.shields.io/badge/release-2.0.0-yellow.svg)]()
3+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3626114.svg)](https://doi.org/10.5281/zenodo.3626114)
4+
[![License](https://img.shields.io/packagist/l/doctrine/orm.svg)]()
25

3-
## Cite us
4-
* If you see my code and data useful and use it, please cite us as follows
5-
6-
* Nguyen, T., Nguyen, T., Nguyen, B. M., & Nguyen, G. (2019). Efficient Time-Series Forecasting Using Neural Network and Opposition-Based Coral Reefs Optimization. International Journal of Computational Intelligence Systems, 12(2), 1144-1161.
6+
## Dear friends and followers
7+
* I updated to repository to the newest version, which is very easy to read and reproduce.
8+
* All of our optimizer (meta-heuristics) now deleted and taken the new one from my newest library:
9+
10+
https://pypi.org/project/mealpy/
11+
12+
* If you use my code or library in your project, I would appreciate the cites:
13+
* Nguyen, T., Nguyen, T., Nguyen, B. M., & Nguyen, G. (2019). Efficient Time-Series Forecasting Using Neural Network and Opposition-Based Coral Reefs Optimization. International Journal of Computational Intelligence Systems, 12(2), 1144-1161.
714

815
* Nguyen, T., Nguyen, B. M., & Nguyen, G. (2019, April). Building Resource Auto-scaler with Functional-Link Neural Network and Adaptive Bacterial Foraging Optimization. In International Conference on Theory and Applications of Models of Computation (pp. 501-517). Springer, Cham.
916

1017
* Nguyen, T., Tran, N., Nguyen, B. M., & Nguyen, G. (2018, November). A Resource Usage Prediction System Using Functional-Link and Genetic Algorithm Neural Network for Multivariate Cloud Metrics. In 2018 IEEE 11th Conference on Service-Oriented Computing and Applications (SOCA) (pp. 49-56). IEEE.
1118

1219
* If you want to know more about code, or want a pdf of both above paper, contact me: [email protected]
1320

14-
* Take a look at this repos, the simplify code using python (numpy) for all algorithms above. (without neural networks)
15-
16-
* https://github.com/thieunguyen5991/metaheuristics
17-
1821
## How to read my repository
1922
1. data: include raw and formatted data
2023
2. envs: include conda environment and how to install conda environment
2124
3. utils: Helped functions such as IO, Draw, Math, Settings (for all model and parameters), Preprocessing...
22-
4. paper: include 2 main folders:
23-
* results: forecasting results of all models (3 folders inside)
24-
* final: final forecasting results (runs on server)
25-
* test: testing forecasting results (runs on personal computer, just for test)
26-
* temp: nothing (just for copy of test folder)
27-
* scaling: scaling results
28-
5. model: (4 folders)
25+
4. model: (2 folders)
2926
* root: (want to understand the code, read this classes first)
3027
* root_base.py: root for all models (traditional, hybrid and variants...)
31-
* root_algo.py: root for all optimization algorithms
3228
* traditional: root for all traditional models (inherit: root_base)
3329
* hybrid: root for all hybrid models (inherit: root_base)
34-
* optimizer: (this classes inherit: root_algo.py)
35-
* evolutionary: include algorithms related to evolution algorithm such as GA, DE,..
36-
* swarm: include algorithms related to swarm optimization such as PSO, BFO, ...
37-
* physics: include algorithms related to physics optimization such as QSO, TWO, ...
3830
* main: (final models)
3931
* this classes will use those optimizer above and those root (traditional, hybrid) above
4032
* the running files (outside with the downloaded folder) will call this classes
@@ -80,16 +72,7 @@ For example:
8072
8. OTWO-ELM => otwo_elm_script.py
8173
```
8274

83-
3. In paper/results/final model includes folder's name represent the data such as
84-
```code
85-
cpu: input model would be cpu, output model would be cpu
86-
ram: same as cpu
87-
multi_cpu : input model would be cpu and ram, output model would be cpu
88-
multi_ram : input model would be cpu and ram, output model would be ram
89-
multi : input model would be cpu and ram, output model would be cpu and ram
90-
```
91-
92-
4. How to change model's parameters?
75+
### How to change model's parameters?
9376
```code
9477
You can change the model's parameters in file: utils/SettingPaper.py
9578
@@ -124,7 +107,7 @@ mlnn1hl_paras_final = {
124107
ga_elm_paras_final = {
125108
"sliding": [2, 3, 5],
126109
"hidden_size" : [(5, False)],
127-
"activation": [0], # 0: elu, 1:relu, 2:tanh, 3:sigmoid
110+
"activation": ["elu"],
128111
"train_valid_rate": [(0.6, 0.4)],
129112
130113
"epoch": [100],
@@ -137,47 +120,28 @@ ga_elm_paras_final = {
137120
- Same as traditional models.
138121
```
139122

140-
5. Where is the results folder?
123+
### Where is the results folder?
141124
```code
142125
- Look at the running file, for example: ga_elm_script.py
143126
144-
+) For normal runs (Only run 1 time for each model).
127+
+) For 1-time runs (Only run 1 time for each model).
145128
_There are 3 type of results file include: model_name.csv file, model_name.png file and Error-model_name.csv file
146129
_model_name.csv included: y_true and y_predict
147130
_model_name.png is visualized of: y_true and y_predict (test dataset)
148-
_Error-model_name.csv included errors of training dataset after epoch. 1st, 2nd column are: MSE, MAE errors
131+
_Error-model_name.csv included errors of training dataset after epoch. 1st, 2nd column are: MSE errors
149132
150-
=> All 3 type of files above is automatically generated in folder: paper/results/final/...
133+
=> All 3 type of files above is automatically generated in folder which you can set in SettingPaper
151134
152-
+) For stability runs (Run each model 15 times with same parameters).
135+
+) For stability runs (Run each model n-time with same parameters).
153136
Because in this test, we don't need to visualize the y_true and y_predict and also don't need to save y_true and y_predict
154-
So I just save 15 times running in the same csv files in folder: paper/results/stability/...
137+
So I just save n-time running in the same csv files in folder
155138
156139
- Noted:
157140
158-
+ In the training set we can use MSE or MAE error. But for the testing set, we can use so much more error like: R2, MAPE, ...
141+
+ In the training set we use MSE. But for the testing set, we can use so much more error like: R2, MAPE, ...
159142
You can find the function code described it in file:
160143
model/root/root_base.py
161-
+ _save_results__: this is for normal runs
162-
+ _save_results_ntimes_run__: this is for stability runs.
163-
164-
+ You want to change the directory to save results?. Simple.
165-
166-
For example: Look at running file: ga_elm_script.py
167-
168-
_Line 14: pathsave = "paper/results/final/" --> This is general path to save file.
169-
But for each dataset like: wc, uk, eu,... I need to save it in different folder right. So now look at
170-
171-
_Line 34: "path_save_result": pathsave + requirement_variables[4].
172-
Here, the requirement_variables[4]: is inside file: utils/SettingPaper.py ("eu/", # path_save_result)
173-
174-
So the final path to save the results for normal runs is: paper/results/final/eu/
144+
+ _save_results__:
175145
```
176146

177-
6. Take a look at project_structure.md file. Describe how the project was built.
178-
179-
180-
## License
181-
182-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
183-
147+
* Take a look at project_structure.md file. Describe how the project was built.

0 commit comments

Comments
 (0)