Skip to content

Instantly share code, notes, and snippets.

@mtrazzi
mtrazzi / icml_scraping.py
Created July 23, 2023 21:17
To run on your machine locally. Do not share the data publicly. Allow decent waiting time between requests.
import requests
from bs4 import BeautifulSoup
import pandas as pd
import time
import random
# List of URLs to scrape
urls = [
"https://icml.cc/virtual/2023/poster/24721",
"https://icml.cc/virtual/2023/poster/24944",
# start by installing xdotool
# sudo apt-get install xdotool
# then get the "Interested" coordinates as X_INT and Y_INT
# sleep 2; xdotool getmouselocation --shell
# then run the script!
X_INT=577; Y_INT=413;
"""Objective: Reduce action space to speed up training time
1st Action: No-Op, wait 1 frame to allow pictures to appears
2nd Action: True Action taken
3rd Action: Reverse action to go back at the center of the screen
4th Action: No-Op, to wait 1 frame to allow the cross to appears
"""
_, r_, _, _ = self.env.step(np.array([0, 0, 0, 0, 0, 0, 0], dtype=np.intc))
s1, r, d, t = self.env.step(action, True)
r += r_
if not d:
### START MULTIPROCESSING
#########################
num_processes = 32
# Define an output queue
output = mp.Queue()
# Setup a list of processes that we want to run
processes = [mp.Process(target=episode, args=(self.env, self.local_AC, sess, rnn_state)) for i in range(num_processes)]
import deepmind_lab
class WrapperEnv(object):
"""A gym-like wrapper environment for DeepMind Lab.
(Work in Progress)
Attributes:
env: The corresponding DeepMind Lab environment.
length: Maximum number of frames
#!/bin/bash
#
# This script creates a temporary directory with the structure required by
# setuptools to build the deepmind_lab package and generates a binary
# distribution in the directory specified.
#
# This should be invoked directly and not via "bazel run" since the working
# directory has to be the root of the build tree.
set -e
import deepmind_lab
class wrapper_env(object):
"""A gym-like wrapper environment for DeepMind Lab.
Attributes:
env: The corresponding DeepMind Lab environment.
timestep: the number of frames/actions since the beginnning.
Args:
env (deepmind_lab.Lab): DeepMind Lab environment.
"""