repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_gpqa.py
tests/jaster/test_gpqa.py
from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.gpqa_en import GPQAMainEnDatasetProcessor def test_preprocess(tmp_path): dataset_dir = tmp_path / "gpqa" dataset_dir.mkdir() csv_file = dataset_dir / "gpqa_main.csv" csv_file.write_text( ( "Question,Correct Answer,...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_jhumaneval.py
tests/jaster/test_jhumaneval.py
from textwrap import dedent from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.jhumaneval import JHumanEvalDatasetProcessor content_dict = { "task_id": {0: "JHumanEval/0", 1: "JHumanEval/1"}, "prompt_en": { 0: 'from typing import List\n\n\ndef has_close_elements(numbers: List[float], t...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_polymath.py
tests/jaster/test_polymath.py
from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.polymath import PolyMathEnDatasetProcessor, PolyMathJaDatasetProcessor content_ja = """ {"id": "low-ja-1", "question": "5年生の生徒200人のうち、2/5の生徒が男の子で、女の子の2/3がガールスカウトに入っている。ガールスカウトに入っていない女の子は何人?", "answer": "40"} {"id": "high-ja-2", "question": "凸多面体 $P$ は ...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_jamp.py
tests/jaster/test_jamp.py
from textwrap import dedent from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.jamp import JAMPDatasetProcessor content = dedent( """ num premise hypothesis gold_label template_num time_format time_span category 1 ボブはホームに交流戦を迎えている。 ボブは現在ホームに交流戦を迎えている。 entailment 0 None None 現在(現在形) 2 トレントは問いに喉を開いて...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_jemhopqa.py
tests/jaster/test_jemhopqa.py
from textwrap import dedent from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.jemhopqa import JEMHopQADatasetProcessor content = dedent( """ [ { "qid": "45cad48d43f222048ea4a498fd29c4a1", "type": "comparison", "question": "『仮面ライダー電王』と『あまちゃん』、放送回数が多いのはどちらでしょう?", "answer": "あまちゃん"...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_jhle.py
tests/jaster/test_jhle.py
import json from textwrap import dedent from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.jhle import JHumanitysLastExamDatasetProcessor # Dummy data following the HLE format content = [ { "id": "ダミー", "question": "この問題はダミーです。", "answer": "ダミー", "answer_type": "ex...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_jmmlu.py
tests/jaster/test_jmmlu.py
from textwrap import dedent from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.jmmlu import JMMLUDatasetProcessor content = """ 正当性とは何か?,司法適格性とは、関連する権利者による特定の権利の行使の可能性を指す,司法適格性とは、特定の権利の正当な性質または原因を指す,司法適格性とは、特定の権利の不行使が正義の原則に合致するかどうかを裁判所が評価することを指す,司法適格性とは、特定の権利を行使する国家の義務を指す,A 保護責任(R2P)は人道的介入とどのような点で異なるか...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_jsick.py
tests/jaster/test_jsick.py
from textwrap import dedent from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.jsick import JSICKDatasetProcessor content = """ pair_ID\tdata\tsentence_A_En\tsentence_B_En\tentailment_label_En\trelatedness_score_En\tcorr_entailment_labelAB_En\tcorr_entailment_labelBA_En\tsentence_A_Ja\tsentence_B_Ja\t...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_alt.py
tests/jaster/test_alt.py
from textwrap import dedent from llm_jp_eval.jaster.alt import ALTBaseDatasetProcessor def test_parse_data_file_normal_case(temp_file): content = dedent( """ SNT.80188.1 フランスのパリ、パルク・デ・プランスで行われた2007年ラグビーワールドカップのプールCで、イタリアは31対5でポルトガルを下した。 SNT.80188.2 アンドレア・マージが開始4分後のトライでイタリアにとって最初の得点を入れた。 ...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_jcola.py
tests/jaster/test_jcola.py
from textwrap import dedent from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.jcola import JCoLADatasetProcessor content = """ { "uid": 1001, "source": "Test_2025", "label": 1, "diacritic": "g", "sentence": "test sentence 0", "original": "test original 0" } { "uid": 1002, "source": "Test_2024", "labe...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_drop.py
tests/jaster/test_drop.py
from textwrap import dedent from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.drop import DropDatasetProcessor content = """ {"section_id":"nfl_2201","query_id":"f16c0ee7-f131-4a8b-a6ac-4d275ea68066","passage":"To start the season, the Lions traveled south to Tampa, Florida to take on the Tampa Bay B...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_commonsensemoralja.py
tests/jaster/test_commonsensemoralja.py
from textwrap import dedent from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.commonsensemoralja import CommonsenseMoralJaDatasetProcessor content = dedent( """ ,sent,label 0,掃除当番を押し付けた,1 1,掃除当番をくじ引きで決めた,0 """ ).strip() def test_dataset(temp_file): file_path = temp_file(content, filename="t...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_gsm8k.py
tests/jaster/test_gsm8k.py
from textwrap import dedent from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.gsm8k import GSM8KDatasetProcessor content = """ {"question": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?", "a...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_jsts.py
tests/jaster/test_jsts.py
from textwrap import dedent from llm_jp_eval.jaster.base import Sample from llm_jp_eval.jaster.jsts import JSTSDatasetProcessor content = """ {"sentence_pair_id": "0", "yjcaptions_id": "10005_480798-10996-92616", "sentence1": "川べりでサーフボードを持った人たちがいます。", "sentence2": "トイレの壁に黒いタオルがかけられています。", "label": 0.0} {"sentence_pai...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/jaster/test_jblimp.py
tests/jaster/test_jblimp.py
from textwrap import dedent from llm_jp_eval.jaster.base import Sample, Split from llm_jp_eval.jaster.jblimp import JBLiMPDatasetProcessor test_samples = [ { "ID": 0, "good_sentence": "test good sentence 0", "bad_sentence": "test bad sentence 0", "type": "test type", "pheno...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/exporter/__init__.py
tests/exporter/__init__.py
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
llm-jp/llm-jp-eval
https://github.com/llm-jp/llm-jp-eval/blob/a5b71613317dfc051714585740f5a2be006ea1d0/tests/exporter/test_exporter.py
tests/exporter/test_exporter.py
from unittest.mock import MagicMock import pytest from llm_jp_eval.exporter.base import EvaluationExporter, ExportConfigBase, OutputRecord class DummyConfig(ExportConfigBase): exporter_type = "dummy" @property def exporter_class(self): return DummyExporter class DummyExporter(EvaluationExport...
python
Apache-2.0
a5b71613317dfc051714585740f5a2be006ea1d0
2026-01-05T07:13:14.125338Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/__init__.py
rl_gp_mpc/__init__.py
from .control_objects.controllers.gp_mpc_controller import GpMpcController from .visu_objects.visu_object import ControlVisualizations
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/run_env_function.py
rl_gp_mpc/run_env_function.py
import time import numpy as np import matplotlib.pyplot as plt from gym.core import Env from rl_gp_mpc import GpMpcController from rl_gp_mpc import ControlVisualizations from rl_gp_mpc.config_classes.visu_config import VisuConfig from rl_gp_mpc.config_classes.total_config import Config NUM_DECIMALS_REPR = 3 np.set_pr...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/visu_objects/visu_object.py
rl_gp_mpc/visu_objects/visu_object.py
import os import multiprocessing import copy import time import numpy as np from gym.wrappers.monitoring.video_recorder import VideoRecorder from gym.core import Env from rl_gp_mpc.config_classes.visu_config import VisuConfig from rl_gp_mpc.config_classes.total_config import Config from rl_gp_mpc.control_objects.cont...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/visu_objects/static_2d_graph.py
rl_gp_mpc/visu_objects/static_2d_graph.py
import datetime import os import matplotlib.pyplot as plt import numpy as np from rl_gp_mpc.control_objects.controllers.iteration_info_class import IterationInformation ALPHA_CONFIDENCE_BOUNDS = 0.4 UPDATE_X_LIMIT = True MUL_STD_BOUNDS = 3 def save_plot_2d(states, actions, costs, model_iter_infos: "list[Iteration...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/visu_objects/dynamic_2d_graph.py
rl_gp_mpc/visu_objects/dynamic_2d_graph.py
import time import threading import queue import multiprocessing import matplotlib import matplotlib.pyplot as plt import numpy as np import imageio from rl_gp_mpc.control_objects.controllers.iteration_info_class import IterationInformation # matplotlib.use('TkAgg') matplotlib.rc('font', size='6') ALPHA_CONFIDENCE_B...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/visu_objects/static_3d_graph.py
rl_gp_mpc/visu_objects/static_3d_graph.py
import os import datetime import torch import gpytorch import matplotlib.pyplot as plt from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler from sklearn.neighbors import KNeighborsRegressor import numpy as np from rl_gp_mpc.control_objects.models.gp_model import create_models, SavedS...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/visu_objects/utils.py
rl_gp_mpc/visu_objects/utils.py
import datetime import os def get_env_name(env): try: env_name = env.env.spec.entry_point.replace('-', '_').replace(':', '_').replace('.', '_') except: env_name = env.name return env_name def create_folder_save(env_name): datetime_now = datetime.datetime.now() folder_save = os.path....
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/envs/process_control.py
rl_gp_mpc/envs/process_control.py
import numpy as np import gym from gym import spaces class ProcessControl(gym.Env): """ Example of custom Environment that follows gym interface. The additional methods: - define_params: used to be able to vary the internal parameters of the env to check the robustness of the control to change in the env. ...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/config_classes/memory_config.py
rl_gp_mpc/config_classes/memory_config.py
from .utils.functions_process_config import convert_config_lists_to_tensor class MemoryConfig: def __init__(self, check_errors_for_storage:bool=True, min_error_prediction_state_for_memory:"list[float]"=[3e-4, 3e-4, 3e-4], min_prediction_state_std_for_memory:"list[float]"=[3e-3, 3e-3, 3e-3], points_batch_me...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/config_classes/actions_config.py
rl_gp_mpc/config_classes/actions_config.py
from .utils.functions_process_config import convert_config_lists_to_tensor class ActionsConfig: def __init__( self, limit_action_change:bool=False, max_change_action_norm:"list[float]"=[0.05], ): """ limit_action_change: if set to true, the actions will stay close to the action of the previous time step...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/config_classes/visu_config.py
rl_gp_mpc/config_classes/visu_config.py
class VisuConfig: def __init__( self, save_render_env:bool=True, render_live_plot_2d:bool=True, render_env:bool=True, save_live_plot_2d:bool=False ): """ save_render_env: if set to true and render_env is true, will save the env animation render_live_plot_2d: if true, will show the dynamic 2d graph upd...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/config_classes/observation_config.py
rl_gp_mpc/config_classes/observation_config.py
import torch class ObservationConfig: def __init__( self, obs_var_norm:"list[float]"=[1e-6, 1e-6, 1e-6] ): """ obs_var_norm: uncertainty of the observation used by the model """ self.obs_var_norm = torch.diag(torch.Tensor(obs_var_norm))
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/config_classes/training_config.py
rl_gp_mpc/config_classes/training_config.py
class TrainingConfig: def __init__( self, lr_train:float=7e-3, iter_train:int=15, training_frequency:int=25, clip_grad_value:float=1e-3, print_train:bool=False, step_print_train:int=5 ): """ lr_train: learning rate when training the hyperparameters of the model iter_train: number of iteration when...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/config_classes/reward_config.py
rl_gp_mpc/config_classes/reward_config.py
import torch from .utils.functions_process_config import convert_config_lists_to_tensor class RewardConfig: def __init__( self, target_state_norm:"list[float]"=[1, 0.5, 0.5], weight_state:"list[float]"=[1, 0.1, 0.1], weight_state_terminal:"list[float]"=[10, 5, 5], target_action_norm:"list[float]"=[0.5],...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/config_classes/model_config.py
rl_gp_mpc/config_classes/model_config.py
from .utils.functions_process_config import convert_dict_lists_to_dict_tensor, extend_dim, extend_dim_lengthscale_time class ModelConfig: def __init__( self, gp_init:dict = { "noise_covar.noise": [1e-4, 1e-4, 1e-4], # variance = (std)² "base_kernel.lengthscale": [[0.75, 0.75, 0.75, 0.75], [0.75, ...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/config_classes/controller_config.py
rl_gp_mpc/config_classes/controller_config.py
class ControllerConfig: def __init__(self, len_horizon:int=15, actions_optimizer_params:dict={ "disp": None, "maxcor": 30, "ftol": 1e-99, "gtol": 1e-99, "eps": 1e-2, "maxfun": 30, "maxiter": 30, "iprint": -1, "maxls": 30, "finite_diff_rel_step": None }, init_from_previous_actions:bool=True, restarts_...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/config_classes/total_config.py
rl_gp_mpc/config_classes/total_config.py
import torch from .controller_config import ControllerConfig from .actions_config import ActionsConfig from .model_config import ModelConfig from .training_config import TrainingConfig from .reward_config import RewardConfig from .observation_config import ObservationConfig from .memory_config import MemoryConfig tor...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/config_classes/utils/functions_process_config.py
rl_gp_mpc/config_classes/utils/functions_process_config.py
import torch def convert_config_lists_to_tensor(self): for attr, value in self.__dict__.items(): if isinstance(value, list): setattr(self, attr, torch.Tensor(value)) return self def convert_dict_lists_to_dict_tensor(dict_list: "dict[list]"): for attr, value in dict_list.items(): ...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/__init__.py
rl_gp_mpc/control_objects/__init__.py
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/actions_mappers/action_init_functions.py
rl_gp_mpc/control_objects/actions_mappers/action_init_functions.py
import numpy as np def generate_mpc_action_init_random(len_horizon, dim_action): return np.random.uniform(low=0, high=1, size=(len_horizon, dim_action)).reshape(-1) def generate_mpc_action_init_frompreviousiter(actions_mpc, dim_action): actions_mpc[:-dim_action] = actions_mpc[dim_action:] return actions_mpc de...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/actions_mappers/abstract_action_mapper.py
rl_gp_mpc/control_objects/actions_mappers/abstract_action_mapper.py
from typing import Union import numpy as np import torch from rl_gp_mpc.config_classes.actions_config import ActionsConfig class AbstractActionMapper: ''' Class use to map actions to space between 0 and 1. The optimiser constraints the embed_action to be between 0 and 1. By using this class, the action can be c...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/actions_mappers/derivative_action_mapper.py
rl_gp_mpc/control_objects/actions_mappers/derivative_action_mapper.py
from typing import Union import numpy as np import torch from rl_gp_mpc.config_classes.actions_config import ActionsConfig from rl_gp_mpc.control_objects.utils.pytorch_utils import Clamp from .abstract_action_mapper import AbstractActionMapper class DerivativeActionMapper(AbstractActionMapper): def __init__(self, a...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/actions_mappers/normalization_action_mapper.py
rl_gp_mpc/control_objects/actions_mappers/normalization_action_mapper.py
from typing import Union import numpy as np import torch from rl_gp_mpc.config_classes.actions_config import ActionsConfig from .abstract_action_mapper import AbstractActionMapper class NormalizationActionMapper(AbstractActionMapper): def __init__(self, action_low:Union[np.ndarray, torch.Tensor], action_high:Union...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/memories/gp_memory.py
rl_gp_mpc/control_objects/memories/gp_memory.py
import torch import numpy as np from rl_gp_mpc.config_classes.memory_config import MemoryConfig from rl_gp_mpc.control_objects.utils.data_utils import form_model_input class Memory: def __init__(self, config:MemoryConfig, dim_input, dim_state, include_time_model=False, step_model=1): self.config = config...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/controllers/iteration_info_class.py
rl_gp_mpc/control_objects/controllers/iteration_info_class.py
import numpy as np import torch NUM_DECIMALS_REPR = 3 class IterationInformation: def __init__(self, iteration:int, state:float, cost:float, cost_std:float, mean_predicted_cost:float, mean_predicted_cost_std:float, lower_bound_mean_predicted_cost:float, predicted_idxs:np.array, predicted_states:np....
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/controllers/abstract_controller.py
rl_gp_mpc/control_objects/controllers/abstract_controller.py
from rl_gp_mpc.config_classes.total_config import Config class BaseControllerObject: def __init__(self, config: Config): raise NotImplementedError def add_memory(self, obs, action, obs_new, reward, **kwargs): raise NotImplementedError() def get_action(self, obs_mu, obs_var=None): ...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/controllers/gp_mpc_controller.py
rl_gp_mpc/control_objects/controllers/gp_mpc_controller.py
import multiprocessing import numpy as np import torch from scipy.optimize import minimize from rl_gp_mpc.control_objects.actions_mappers.action_init_functions import generate_mpc_action_init_random, generate_mpc_action_init_frompreviousiter from rl_gp_mpc.config_classes.total_config import Config from rl_gp_mpc.cont...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/observations_states_mappers/abstract_observation_state_mapper.py
rl_gp_mpc/control_objects/observations_states_mappers/abstract_observation_state_mapper.py
from typing import Union import numpy as np import torch from rl_gp_mpc.config_classes.observation_config import ObservationConfig class AbstractObservationStateMapper: def __init__(self, observation_low: Union[np.ndarray, torch.Tensor], observation_high: Union[np.ndarray, torch.Tensor], config:ObservationConfig): ...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/observations_states_mappers/normalization_observation_state_mapper.py
rl_gp_mpc/control_objects/observations_states_mappers/normalization_observation_state_mapper.py
from typing import Union import numpy as np import torch from rl_gp_mpc.config_classes.observation_config import ObservationConfig from .abstract_observation_state_mapper import AbstractObservationStateMapper class NormalizationObservationStateMapper(AbstractObservationStateMapper): def __init__(self, observation_...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/models/gp_model.py
rl_gp_mpc/control_objects/models/gp_model.py
import multiprocessing import time import torch import gpytorch import numpy as np from rl_gp_mpc.config_classes.model_config import ModelConfig from .abstract_model import AbstractStateTransitionModel class SavedState: def __init__(self, inputs:torch.Tensor, states_change: torch.Tensor, parameters:"list[dict]...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/models/abstract_model.py
rl_gp_mpc/control_objects/models/abstract_model.py
import torch from rl_gp_mpc.config_classes.model_config import ModelConfig class AbstractStateTransitionModel: def __init__(self, config:ModelConfig, dim_state, dim_action): self.config = config self.dim_state = dim_state self.dim_action = dim_action self.dim_input = self.dim_state + self.dim_action def pr...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/utils/data_utils.py
rl_gp_mpc/control_objects/utils/data_utils.py
import torch def form_model_input(state, action_model, time_idx, include_time_model, dim_input): x = torch.empty(dim_input) x[:((state.shape[0] + action_model.shape[0]))] = torch.cat((state, action_model)) if include_time_model: x[-1] = time_idx return x
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/utils/pytorch_utils.py
rl_gp_mpc/control_objects/utils/pytorch_utils.py
import torch from math import sqrt class Clamp(torch.autograd.Function): # This class allow the flow of gradient when at the boundary. Otherwise, when using the clamp function from pytorch, the action remains blocked at 0 or 1 @staticmethod def forward(ctx, input, min, max): return input.clamp(min=mi...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/states_reward_mappers/abstract_state_reward_mapper.py
rl_gp_mpc/control_objects/states_reward_mappers/abstract_state_reward_mapper.py
import torch from rl_gp_mpc.config_classes.reward_config import RewardConfig class AbstractStateRewardMapper: def __init__(self, config:RewardConfig): self.config = config def get_reward(self, state_mu:torch.Tensor, state_var: torch.Tensor, action:torch.Tensor): raise NotImplementedError def get_reward_termi...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/rl_gp_mpc/control_objects/states_reward_mappers/setpoint_distance_reward_mapper.py
rl_gp_mpc/control_objects/states_reward_mappers/setpoint_distance_reward_mapper.py
import torch from rl_gp_mpc.config_classes.reward_config import RewardConfig from .abstract_state_reward_mapper import AbstractStateRewardMapper from ..utils.pytorch_utils import normal_cdf class SetpointStateRewardMapper(AbstractStateRewardMapper): def __init__(self, config:RewardConfig): super().__init__(config...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/examples/pendulum/config_pendulum.py
examples/pendulum/config_pendulum.py
from rl_gp_mpc.config_classes.total_config import Config from rl_gp_mpc.config_classes.controller_config import ControllerConfig from rl_gp_mpc.config_classes.actions_config import ActionsConfig from rl_gp_mpc.config_classes.reward_config import RewardConfig from rl_gp_mpc.config_classes.observation_config import Obser...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/examples/pendulum/run_pendulum.py
examples/pendulum/run_pendulum.py
import sys import os file_path = os.path.abspath(__file__) sys.path.append(os.path.join(os.path.dirname(file_path), '../../')) import gym from rl_gp_mpc.config_classes.visu_config import VisuConfig from rl_gp_mpc.run_env_function import run_env from config_pendulum import get_config def run_pendulum(): num_step...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/examples/pendulum/run_pendulum_multiple.py
examples/pendulum/run_pendulum_multiple.py
import sys import os file_path = os.path.abspath(__file__) sys.path.append(os.path.join(os.path.dirname(file_path), '../../')) import gym from rl_gp_mpc.config_classes.visu_config import VisuConfig from rl_gp_mpc.run_env_function import run_env_multiple from config_pendulum import get_config if __name__ == '__main_...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/examples/mountain_car/config_mountaincar.py
examples/mountain_car/config_mountaincar.py
from rl_gp_mpc.config_classes.total_config import Config from rl_gp_mpc.config_classes.controller_config import ControllerConfig from rl_gp_mpc.config_classes.actions_config import ActionsConfig from rl_gp_mpc.config_classes.reward_config import RewardConfig from rl_gp_mpc.config_classes.observation_config import Obser...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/examples/mountain_car/run_mountain_car_multiple.py
examples/mountain_car/run_mountain_car_multiple.py
import sys import os file_path = os.path.abspath(__file__) sys.path.append(os.path.join(os.path.dirname(file_path), '../../')) import gym from rl_gp_mpc.config_classes.visu_config import VisuConfig from config_mountaincar import get_config from rl_gp_mpc.run_env_function import run_env_multiple if __name__ == '__ma...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/examples/mountain_car/run_mountaincar.py
examples/mountain_car/run_mountaincar.py
import sys import os file_path = os.path.abspath(__file__) sys.path.append(os.path.join(os.path.dirname(file_path), '../../')) import gym from rl_gp_mpc.config_classes.visu_config import VisuConfig from rl_gp_mpc.run_env_function import run_env from config_mountaincar import get_config def run_mountain_car(num_step...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/examples/process_control/config_process_control.py
examples/process_control/config_process_control.py
from rl_gp_mpc.config_classes.total_config import Config from rl_gp_mpc.config_classes.controller_config import ControllerConfig from rl_gp_mpc.config_classes.actions_config import ActionsConfig from rl_gp_mpc.config_classes.reward_config import RewardConfig from rl_gp_mpc.config_classes.observation_config import Obser...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/examples/process_control/run_processc_control_multiple.py
examples/process_control/run_processc_control_multiple.py
import sys import os file_path = os.path.abspath(__file__) sys.path.append(os.path.join(os.path.dirname(file_path), '../../')) from rl_gp_mpc.envs.process_control import ProcessControl from rl_gp_mpc.config_classes.visu_config import VisuConfig from config_process_control import get_config from rl_gp_mpc.run_env_fun...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control
https://github.com/SimonRennotte/Data-Efficient-Reinforcement-Learning-with-Probabilistic-Model-Predictive-Control/blob/e73e805688792b4d63fcee08f4eb06a7fab46a11/examples/process_control/run_process_control.py
examples/process_control/run_process_control.py
import sys import os file_path = os.path.abspath(__file__) sys.path.append(os.path.join(os.path.dirname(file_path), '../../')) from rl_gp_mpc.config_classes.visu_config import VisuConfig from rl_gp_mpc.envs.process_control import ProcessControl from rl_gp_mpc.run_env_function import run_env from config_process_control...
python
MIT
e73e805688792b4d63fcee08f4eb06a7fab46a11
2026-01-05T07:13:13.323103Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/download-model.py
download-model.py
''' Downloads models from Hugging Face to models/model-name. Source: https://github.com/oobabooga/text-generation-webui Example: python download-model.py facebook/opt-1.3b ''' import argparse import base64 import datetime import hashlib import json import re import sys from pathlib import Path import requests impor...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/bootstrap_models.py
bootstrap_models.py
import sys import os import subprocess DEFAULT_EMBEDDINGS_MODEL ="sentence-transformers/all-MiniLM-L6-v2" DEFAULT_MODEL = "openlm-research/open_llama_3b" MODEL_DIR = "./models" def _download_if_not_exists(model): models_dir = os.path.join(MODEL_DIR, model) if os.path.exists(models_dir): print(f"Direc...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/main.py
app/main.py
import os import shutil from fastapi import FastAPI, Depends, UploadFile from fastapi.middleware.cors import CORSMiddleware from sqlmodel import SQLModel, create_engine, Session, desc from models.all import Conversation, Message, ConversationWithMessages from typing import List from settings import load_config, logger ...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/settings.py
app/settings.py
import os from dotenv import load_dotenv import logging from langchain.embeddings import ( HuggingFaceEmbeddings, HuggingFaceInstructEmbeddings, ) class CustomFormatter(logging.Formatter): grey = "\x1b[38;20m" yellow = "\x1b[33;20m" red = "\x1b[31;20m" bold_red = "\x1b[31;1m" reset = "\x1b...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/__init__.py
app/__init__.py
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/guidance_tooling/guidance_programs/tools.py
app/guidance_tooling/guidance_programs/tools.py
from dotenv import load_dotenv from langchain.chains import RetrievalQA from langchain.embeddings import HuggingFaceEmbeddings, HuggingFaceInstructEmbeddings from langchain import HuggingFacePipeline from colorama import Fore, Style import re from langchain.vectorstores import Chroma from langchain.docstore.document im...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/tools/web_access.py
app/tools/web_access.py
from settings import Settings from tools.base import BaseTool config = Settings.load_config() class WebAccess(BaseTool): url: str def commands(self): return {}
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/tools/document_memory.py
app/tools/document_memory.py
from tools.base import BaseTool from tools.utils import _build_conversation_filter from typing import Dict, Any class DocumentSearchTool(BaseTool): def __init__(self, conversation_id: str, tool_context: Dict[str, Any], name: str = "Document Search"): required_context_keys = ["vector_store_docs", "k"] ...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/tools/conversation_memory.py
app/tools/conversation_memory.py
from tools.base import BaseTool from tools.utils import _build_conversation_filter from typing import Dict, Any class ConversationSearchTool(BaseTool): def __init__(self, conversation_id: str, tool_context: Dict[str, Any], name: str = "Conversation Search"): required_context_keys = ["vector_store_convs", "...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/tools/utils.py
app/tools/utils.py
from typing import Optional def _build_conversation_filter(conversation_id: Optional[str]): if conversation_id is not None: return {"conversation_id": conversation_id} else: return {}
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/tools/base.py
app/tools/base.py
from pyparsing import abstractmethod from typing import Dict, List, Any class ToolFactory(): """Instantiates tools with a reference to the current conversation_id""" def __init__(self, list_of_tool_classes: List["BaseTool"]) -> None: self._tool_class_references = list_of_tool_classes def build_to...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/flow/flow.py
app/flow/flow.py
from abc import abstractmethod from colorama import Fore from typing import Tuple, List, Union, Dict from andromeda_chain import AndromedaChain, AndromedaPrompt, AndromedaResponse from agents.base import color_print from prompts.guidance_choice import CHOICE_PROMPT from copy import deepcopy class Node: def __init_...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/flow/__init__.py
app/flow/__init__.py
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/agents/chain_of_thoughts.py
app/agents/chain_of_thoughts.py
from agents.base import BaseAgent from guidance_tooling.guidance_programs.tools import ingest_file from guidance_tooling.guidance_programs.tools import clean_text from langchain.llms import LlamaCpp import os import time import guidance from colorama import Fore, Style from langchain.chains import RetrievalQA from lang...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/agents/flow_cot.py
app/agents/flow_cot.py
from typing import Dict, Callable from andromeda_chain import AndromedaChain from agents.flow_based import BaseFlowAgent from flow.flow import Flow, PromptNode, ToolNode, ChoiceNode, StartNode from prompts.flow_guidance_cot import FlowChainOfThoughts, PROMPT_START_STRING class ChainOfThoughtsFlowAgent(BaseFlowAgent):...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/agents/flow_based.py
app/agents/flow_based.py
# import the necessary libraries from typing import Dict, Callable from agents.base import BaseAgent from colorama import Style from andromeda_chain import AndromedaChain from flow.flow import Flow def color_print(msg, color): print(color + Style.BRIGHT + msg + Style.RESET_ALL) class BaseFlowAgent(BaseAgent): ...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/agents/__init__.py
app/agents/__init__.py
from agents.chain_of_thoughts import ChainOfThoughtsAgent from agents.flow_cot import ChainOfThoughtsFlowAgent
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/agents/base.py
app/agents/base.py
# import the necessary libraries from abc import abstractmethod from colorama import Style, Fore from typing import List from andromeda_chain import AndromedaChain from tools.base import BaseTool def color_print(msg, color): print(color + Style.BRIGHT + msg + Style.RESET_ALL, flush=True) class BaseAgent: ""...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/models/all.py
app/models/all.py
from datetime import datetime from typing import Optional, List from sqlmodel import SQLModel, Field, Relationship from importlib import import_module NAMING_CONVENTION = { "ix": "ix_%(column_0_label)s", "uq": "uq_%(table_name)s_%(column_0_name)s", "ck": "ck_%(table_name)s_%(constraint_name)s", "fk": "...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/memory/chroma_memory.py
app/memory/chroma_memory.py
import os from typing import Any, Iterable, List, Optional, Type from memory.base import BaseMemory from langchain import vectorstores from langchain.embeddings import ( HuggingFaceInstructEmbeddings, HuggingFaceEmbeddings, ) from langchain.docstore.document import Document from settings import load_config, log...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/memory/base.py
app/memory/base.py
from typing import Any, Iterable, List, Optional, Dict, Tuple, Type from pydantic import BaseModel from pyparsing import abstractmethod from langchain.docstore.document import Document from langchain.vectorstores import VectorStore class BaseMemory(BaseModel): collection_name: Optional[str] vector_store: Opti...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/plugins/__init__.py
app/plugins/__init__.py
import importlib import pkgutil import os def load_plugins(app): # Get the current directory plugins_dir = os.path.dirname(__file__) # Iterate over the files in the plugins directory for _, plugin_name, is_package in pkgutil.iter_modules([plugins_dir]): if is_package: # Dynamically...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/plugins/sample_plugin/database.py
app/plugins/sample_plugin/database.py
from datetime import datetime from typing import Optional, List from sqlmodel import SQLModel, Field, Relationship from models.all import Conversation class SamplePluginModelBase(SQLModel): """A base model for SamplePluginModel""" # __tablename__: str = 'sample_plugin_model' created_at: datetime = Field(...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/plugins/sample_plugin/__init__.py
app/plugins/sample_plugin/__init__.py
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/plugins/sample_plugin/routes.py
app/plugins/sample_plugin/routes.py
from fastapi import APIRouter router = APIRouter() @router.get("/") def sample_plugin_route(): return {"message": "Sample plugin route"} # Additional routes and functionality for the sample plugin
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/migrations/env.py
app/migrations/env.py
from logging.config import fileConfig from sqlalchemy import engine_from_config from sqlalchemy import pool from alembic import context from models import all # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file f...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/migrations/versions/51a9f1ab4b8b_add_sample_plugin_demo_model.py
app/migrations/versions/51a9f1ab4b8b_add_sample_plugin_demo_model.py
"""Add Sample Plugin Demo Model Revision ID: 51a9f1ab4b8b Revises: 804b20c9599c Create Date: 2023-06-04 21:30:37.777274 """ from alembic import op import sqlalchemy as sa import sqlmodel.sql.sqltypes # revision identifiers, used by Alembic. revision = '51a9f1ab4b8b' down_revision = '804b20c9599c' branch_labels = No...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/migrations/versions/804b20c9599c_initial.py
app/migrations/versions/804b20c9599c_initial.py
"""initial Revision ID: 804b20c9599c Revises: Create Date: 2023-05-31 20:06:36.912608 """ from alembic import op import sqlalchemy as sa import sqlmodel.sql.sqltypes # revision identifiers, used by Alembic. revision = '804b20c9599c' down_revision = None branch_labels = None depends_on = None def upgrade() -> Non...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/prompts/flow_guidance_cot.py
app/prompts/flow_guidance_cot.py
from andromeda_chain.prompt import AndromedaPrompt PROMPT_START_STRING = """You're an AI assistant with access to tools. You're nice and friendly, and try to answer questions to the best of your ability. You have access to the following tools. {tools_descriptions} Strictly use the following format: Question: the in...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/prompts/guidance_check_question.py
app/prompts/guidance_check_question.py
from andromeda_chain.prompt import AndromedaPrompt PROMPT_CHECK_QUESTION = AndromedaPrompt( name="start-prompt", prompt_template="""You MUST answer with 'yes' or 'no'. Given the following pieces of context, determine if there are any elements related to the question in the context. Don't forget you MUST answe...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/prompts/__init__.py
app/prompts/__init__.py
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/prompts/guidance_choice.py
app/prompts/guidance_choice.py
from andromeda_chain.prompt import AndromedaPrompt CHOICE_PROMPT = AndromedaPrompt( name="choice_prompt", prompt_template = """{{history}} You must now choose an option out of the {{valid_choices}}. Remember that it must be coherent with your last thought. {{select 'choice' logprobs='logprobs' options=valid_...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/conversations/document_based.py
app/conversations/document_based.py
from langchain.document_loaders import TextLoader from memory.chroma_memory import Chroma from langchain.text_splitter import RecursiveCharacterTextSplitter from colorama import Fore, Style from guidance_tooling.guidance_programs.tools import clean_text from andromeda_chain import AndromedaChain from agents import Cha...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/conversations/document_based_flow.py
app/conversations/document_based_flow.py
from langchain.document_loaders import TextLoader from memory.chroma_memory import Chroma from langchain.text_splitter import RecursiveCharacterTextSplitter from andromeda_chain import AndromedaChain from agents import ChainOfThoughtsFlowAgent from tools.base import ToolFactory from tools.document_memory import Docume...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
ChuloAI/BrainChulo
https://github.com/ChuloAI/BrainChulo/blob/cacf3acff407ed131ef02196dfede54d8ff216da/app/prompt_templates/qa_agent.py
app/prompt_templates/qa_agent.py
QA_ETHICAL_AGENT=""" {{#system~}} Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: You are a helpful assistant. Answer the following questions as best you can. You have access to the following t...
python
MIT
cacf3acff407ed131ef02196dfede54d8ff216da
2026-01-05T07:13:18.041503Z
false
Snooz82/robotframework-datadriver
https://github.com/Snooz82/robotframework-datadriver/blob/d2d519666250324478bdccd7ccd65206a9110bf4/create_readme.py
create_readme.py
from inspect import getdoc from pathlib import Path from DataDriver import DataDriver with Path("Readme.rst").open("w", encoding="utf-8") as readme: doc_string = getdoc(DataDriver) readme.write(str(doc_string).replace("\\", "\\\\").replace("\\\\*", "\\*"))
python
Apache-2.0
d2d519666250324478bdccd7ccd65206a9110bf4
2026-01-05T07:13:20.041560Z
false
Snooz82/robotframework-datadriver
https://github.com/Snooz82/robotframework-datadriver/blob/d2d519666250324478bdccd7ccd65206a9110bf4/setup.py
setup.py
import re from pathlib import Path from setuptools import find_packages, setup with Path("Readme.rst").open(encoding="utf-8") as fh: long_description = fh.read() with (Path(__file__).resolve().parent / "src" / "DataDriver" / "DataDriver.py").open( encoding="utf-8" ) as f: VERSION = re.search('\n__version...
python
Apache-2.0
d2d519666250324478bdccd7ccd65206a9110bf4
2026-01-05T07:13:20.041560Z
false
Snooz82/robotframework-datadriver
https://github.com/Snooz82/robotframework-datadriver/blob/d2d519666250324478bdccd7ccd65206a9110bf4/atest/run_atest.py
atest/run_atest.py
from robot.run import run # robot -d logs --listener RobotStackTracer --exclude performanceORfailingORfiltered --loglevel TRACE:INFO --extension robot . result = run( ".", outputdir="logs", listener="RobotStackTracer", exclude="performanceORfailingORfiltered", loglevel="TRACE:INFO", extension=...
python
Apache-2.0
d2d519666250324478bdccd7ccd65206a9110bf4
2026-01-05T07:13:20.041560Z
false
Snooz82/robotframework-datadriver
https://github.com/Snooz82/robotframework-datadriver/blob/d2d519666250324478bdccd7ccd65206a9110bf4/atest/TestCases/Tags/foo_reader.py
atest/TestCases/Tags/foo_reader.py
from DataDriver.AbstractReaderClass import AbstractReaderClass from DataDriver.ReaderConfig import TestCaseData class foo_reader(AbstractReaderClass): def get_data_from_source(self): return self._read_file_to_data_table() def _read_file_to_data_table(self): test_data = [] flipflop = T...
python
Apache-2.0
d2d519666250324478bdccd7ccd65206a9110bf4
2026-01-05T07:13:20.041560Z
false