-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose map multiplication method and add exponential forgetting example
- Loading branch information
1 parent
a815bc0
commit 43003a4
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import os | ||
import pywavemap as wave | ||
|
||
# Load the map | ||
user_home = os.path.expanduser('~') | ||
input_map_path = os.path.join(user_home, "your_map.wvmp") | ||
your_map = wave.Map.load(input_map_path) | ||
|
||
# Use the multiply method to implement exponential forgetting | ||
decay_factor = 0.9 | ||
wave.edit.multiply(your_map, decay_factor) | ||
|
||
# Save the map | ||
output_map_path = os.path.join(user_home, "your_map_decayed.wvmp") | ||
your_map.store(output_map_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters