Merge remote-tracking branch 'origin/pwnagotchi-torch-testing' into pwnagotchi-torch-testing

# Conflicts:
#	requirements.txt
This commit is contained in:
Jeroen Oudshoorn
2023-10-07 00:40:24 +02:00
5 changed files with 10 additions and 12 deletions

2
.github/FUNDING.yml vendored
View File

@ -1,7 +1,7 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHubSponsors-enabled usernames e.g., [user1, user2]
patreon: evilsocket
patreon: pwnagotchi-torch
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel

View File

@ -79,12 +79,12 @@ is_auto_mode() {
# if usb0 is up, we're in MANU
if is_interface_up usb0; then
return 1
return 0
fi
# if eth0 is up (for other boards), we're in MANU
if is_interface_up eth0; then
return 1
return 0
fi
# no override, but none of the interfaces is up -> AUTO
@ -105,12 +105,12 @@ is_auto_mode_no_delete() {
# if usb0 is up, we're in MANU
if is_interface_up usb0; then
return 1
return 0
fi
# if eth0 is up (for other boards), we're in MANU
if is_interface_up eth0; then
return 1
return 0
fi
# no override, but none of the interfaces is up -> AUTO

View File

@ -90,6 +90,7 @@
- libbz2-dev
- libc-ares-dev
- libc6-dev
- libcap-dev
- libdbus-1-dev
- libdbus-glib-1-dev
- libeigen3-dev

View File

@ -21,18 +21,15 @@ def load(config, agent, epoch, from_disk=True):
SB_BACKEND = "stable_baselines3"
try:
from stable_baselines3 import A2C
from baselines.common.vec_env import DummyVecEnv
from baselines.a2c import a2c
logging.debug("[ai] A2C imported in %.2fs" % (time.time() - start))
start = time.time()
from stable_baselines3.a2c import MlpPolicy
from baselines.a2c.policies import MlpPolicy
logging.debug("[ai] MlpPolicy imported in %.2fs" % (time.time() - start))
SB_A2C_POLICY = MlpPolicy
start = time.time()
from stable_baselines3.common.vec_env import DummyVecEnv
logging.debug("[ai] DummyVecEnv imported in %.2fs" % (time.time() - start))
except Exception as e:
logging.debug("[ai] stable_baselines3 not accessible. Trying stable_baselines")

View File

@ -10,7 +10,7 @@ class Parameter(object):
self.min_value = min_value
self.max_value = max_value + 1
# gym.space.Discrete is within [0, 1, 2, ..., n-1]
# gymnasium.space.Discrete is within [0, 1, 2, ..., n-1]
if self.min_value < 0:
self.scale_factor = abs(self.min_value)
elif self.min_value > 0: