mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Merge remote-tracking branch 'origin/pwnagotchi-torch-testing' into pwnagotchi-torch-testing
# Conflicts: # requirements.txt
This commit is contained in:
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@ -1,7 +1,7 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: # Replace with up to 4 GitHubSponsors-enabled usernames e.g., [user1, user2]
|
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
|
open_collective: # Replace with a single Open Collective username
|
||||||
ko_fi: # Replace with a single Ko-fi username
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
@ -79,12 +79,12 @@ is_auto_mode() {
|
|||||||
|
|
||||||
# if usb0 is up, we're in MANU
|
# if usb0 is up, we're in MANU
|
||||||
if is_interface_up usb0; then
|
if is_interface_up usb0; then
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if eth0 is up (for other boards), we're in MANU
|
# if eth0 is up (for other boards), we're in MANU
|
||||||
if is_interface_up eth0; then
|
if is_interface_up eth0; then
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# no override, but none of the interfaces is up -> AUTO
|
# 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 usb0 is up, we're in MANU
|
||||||
if is_interface_up usb0; then
|
if is_interface_up usb0; then
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if eth0 is up (for other boards), we're in MANU
|
# if eth0 is up (for other boards), we're in MANU
|
||||||
if is_interface_up eth0; then
|
if is_interface_up eth0; then
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# no override, but none of the interfaces is up -> AUTO
|
# no override, but none of the interfaces is up -> AUTO
|
||||||
|
@ -90,6 +90,7 @@
|
|||||||
- libbz2-dev
|
- libbz2-dev
|
||||||
- libc-ares-dev
|
- libc-ares-dev
|
||||||
- libc6-dev
|
- libc6-dev
|
||||||
|
- libcap-dev
|
||||||
- libdbus-1-dev
|
- libdbus-1-dev
|
||||||
- libdbus-glib-1-dev
|
- libdbus-glib-1-dev
|
||||||
- libeigen3-dev
|
- libeigen3-dev
|
||||||
|
@ -21,18 +21,15 @@ def load(config, agent, epoch, from_disk=True):
|
|||||||
SB_BACKEND = "stable_baselines3"
|
SB_BACKEND = "stable_baselines3"
|
||||||
|
|
||||||
try:
|
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))
|
logging.debug("[ai] A2C imported in %.2fs" % (time.time() - start))
|
||||||
|
|
||||||
start = time.time()
|
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))
|
logging.debug("[ai] MlpPolicy imported in %.2fs" % (time.time() - start))
|
||||||
SB_A2C_POLICY = MlpPolicy
|
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:
|
except Exception as e:
|
||||||
logging.debug("[ai] stable_baselines3 not accessible. Trying stable_baselines")
|
logging.debug("[ai] stable_baselines3 not accessible. Trying stable_baselines")
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ class Parameter(object):
|
|||||||
self.min_value = min_value
|
self.min_value = min_value
|
||||||
self.max_value = max_value + 1
|
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:
|
if self.min_value < 0:
|
||||||
self.scale_factor = abs(self.min_value)
|
self.scale_factor = abs(self.min_value)
|
||||||
elif self.min_value > 0:
|
elif self.min_value > 0:
|
||||||
|
Reference in New Issue
Block a user