semvec/pypi-packages huggingface dataset:
BBOBtorch 1.0.1
Vectorized BBOB functions in torch
License: MIT

# BBOB torch

Implementation of BBOB functions (Real-Parameter Black-Box Optimization Benchmarking) as specified by https://coco.gforge.inria.fr/downloads/download16.00/bbobdocfunctions.pdf.

All the functions are vectorized and allow to pass potentional solutions in the same `(num_of_solutions, problem_dimension)`.

## Problem description

All the problems are represented by `Problem` class. This class allows to:
- Evaluate your solutions by directly calling it `problem(solutions)`.
- Get problem dimension `problem.dim`.
- Get optimal solution resp. optimal function value using `problem.x_opt` resp. `problem.f_opt`.
- Get boundaries of solution using `problem.min` resp. `problem.max` for each dimension.
- Change underlying type or device using `problem.type(torch.float16)` and `problem.ty(torch.device('cuda:0'))`.

## Problem creation

You can create new instance of each problem by calling corresponding `create_fxx` function. This function accepts problem dimension and can optionally accept device and seed.

```python
import torch
import bbobtorch
problem = bbobtorch.create_f09(40, dev=torch.device('cuda:0'), seed=42)
```

## Example

```python
import matplotlib.pyplot as plt
import numpy as np
import torch
import bbobtorch

x = torch.arange(-5,5, 0.01, dtype=torch.float32)
grid = torch.stack(torch.meshgrid(x, x), -1)
flat_grid = torch.reshape(grid, (-1,2))
xgrid, ygrid = np.meshgrid(x.numpy(), x.numpy())

fn = bbobtorch.create_f22(2, seed=42)  # two dimension with seed 42
results = fn(flat_grid)
results_grid = torch.reshape(results, xgrid.shape) - fn.f_opt

plt.figure(figsize=(6,6))
plt.pcolormesh(xgrid, ygrid, results_grid, cmap='inferno', shading='nearest')
plt.scatter(*fn.x_opt.tolist()[::-1], marker='x', c='r')
plt.show()
```

![BBOB f22 graph](./f22.png)

You can view all the functions in [attached PDF](./rendering.pdf).

--------------

Author: Patrik Valkovič

License: MIT
lldblogger-cli 1.0
__pip_description__
License: MIT

# 使用指引
安装lldblogger
```
pip install lldblogger
```
指定要测试的app目录地址和断点日志配置文件
```
from lldblogger.runner import Runner

runner = Runner(log_output_path='log file path')
runner.run("path to app", "path to config json")

...

runner.terminate() # 停止调试
```
app文件可以从debug配置的ipa包中解压出来，同时需要将配套的dSYM文件置于同一个目录，可以通过Runner的构造函数指定断点日志输出到哪个文件。

断点日志配置文件格式如下:

```
[
  {
    "file": "文件名",
    "line": 48,
    "log": "[测试串行队列] counter： @counter@"
  },
  {
    "symbol": "-[ViewController viewDidLoad]",
    "log": "<From LLDB> [LLDBTest] 使用符号断点 ViewController viewDidLoad"
  }
]
```
目前支持两种形式的断点日志
1. 指定文件名和代码行数，`file`表示文件名，比如`AppDelegate.m`，`line`表示代码行数，`log`表示要打印的日志
2. 指定方法的符号名称`symbol`，同样`log`表示要打印的日志

日志`log`可以包含动态参数，使用`@@`包裹动态参数，比如要打印局部变量`localVar`，可以这么写
```
"log": "局部变量：@localVar@"
```

目前已测试的动态参数支持情况：
1. 方法的参数
1. 局部变量
1. 静态变量
1. 类的实例变量
1. 简单的表达式