Load External Modules in GRID

The GRID notebook interface is designed to be flexible, allowing installation and use of external Python modules similar to Google Colab. This enables experimentation with different versions of libraries or the addition of new dependencies. It is important to note that all installed packages and defined variables are temporary and will be reset once the session ends.

Example: Installing and custom package

To leverage the capabilities of the stable-baselines3 package for reinforcement learning, it can be easily installed within the GRID environment using a pip command.

  1. Install the `stable-baselines3` Package

    The package can be installed using the following command:

    !pip install stable-baselines3
    
  2. Import and Use `stable-baselines3`

    After installation, the package can be imported and utilized as needed:

    from stable_baselines3 import PPO
    
    # Example: Create a model
    model = PPO('MlpPolicy', 'CartPole-v1', verbose=1)
    model.learn(total_timesteps=10000)
    

    Note

    Upon restarting the session, all installed modules will be cleared. Reinstallation is necessary for each new session, ensuring a fresh environment every time.