Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcbdfa7d

Browse files
committed
doc update
1 parentb158f47 commitcbdfa7d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

‎README.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Now featuring AntennaCAT hooks for GUI integration and user input handling.
1111
*[Implementation](#implementation)
1212
*[Initialization](#initialization)
1313
*[State Machine-based Structure](#state-machine-based-structure)
14+
*[Importing and Exporting Optimizer State](#importing-and-exporting-optimizer-state)
1415
*[Constraint Handling](#constraint-handling)
1516
*[Boundary Types](#boundary-types)
1617
*[Multi-Objective Optimization](#multi-objective-optimization)
@@ -194,6 +195,30 @@ The code below is an example of this process:
194195
print("Best Eval")
195196
print(best_eval)
196197
```
198+
###Importing and Exporting Optimizer State
199+
200+
Some optimizer information can be exported or imported. This varies based on each optimizer.
201+
202+
Optimizer state can be exported at any step. When importing an optimizer state, the optimizer should be initialized first, and then the state information can be imported via a Python pickle file. Other methods can be used if custom code is written to handle preprocessing.
203+
204+
205+
Returning data from optimizer and saving to a .pkl file:
206+
```python
207+
data= demo_optimizer.export_swarm()
208+
data_df= pd.DataFrame(data)
209+
print(data_df)
210+
data_df.to_pickle('output_data_df.pkl')
211+
212+
```
213+
214+
215+
Importing data from a .pkl file and importing it into the optimizer:
216+
```python
217+
data_df= pd.read_pickle('output_data_df.pkl')
218+
demo_optimizer.import_swarm(data_df)
219+
220+
```
221+
197222

198223
###Constraint Handling
199224
Users must create their own constraint function for their problems, if there are constraints beyond the problem bounds. This is then passed into the constructor. If the default constraint function is used, it always returns true (which means there are no constraints).

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp