perpplot比较多个函数的性能与多个参数(多个)
我想通过使用多个参数的perpplot
来显示某些功能的性能,但是我不知道该怎么做(我对perppertplot
不太熟悉代码>)。一个人说 >,但是我很困惑,但如何使用它。假设我们具有以下功能:
from scipy.ndimage import zoom
import numpy as np
f = 5
n = 3
arr = np.random.random_integers(0, 1, (f, f))
def scipy_zoom(arr, n):
return zoom(arr, n)
def numpy_rep(arr, n):
return arr.repeat(n, 0).repeat(n, 1)
f
和n
需要评估更改,并且似乎最好单独绘制它们,即一旦f
保持恒定,n
变化,一次反之亦然。我不知道如果强> perpplot 可以绘制(如果在答案中显示,但不是这个问题的主要目的)。
I would like to show performance of some functions by perfplot
that uses more than one arguments, but I don't know how could I do this (I'm not familiar much with perfplot
). One said broadcast all args to just x, but I am confused yet how to use it. Assume we have the following functions:
from scipy.ndimage import zoom
import numpy as np
f = 5
n = 3
arr = np.random.random_integers(0, 1, (f, f))
def scipy_zoom(arr, n):
return zoom(arr, n)
def numpy_rep(arr, n):
return arr.repeat(n, 0).repeat(n, 1)
Both f
and n
changes need to be evaluated and it seems it will be better to plot them separately i.e. once f
be constant and n
varies and once vice-versa. I don't know how understandable it will be if the 3D perfplot could be plotted (this will be useful if be shown in the answers, but not the main aim of this question).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于两个参数,我们可以收集所有基准时间安排,以 factials.partials.partial 和 N 在
perpplot
中,并绘制了2D行绘图层的3D图。
输出
For two arguments we can collect all benchmark timings, setting the range of f for arr size with
functools.partial
and the range of n withinperfplot
and plot a 3D graph of 2D line plot layers.
Output