delay_estimator.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:pactools 作者: pactools 项目源码 文件源码
def plot(self, ax=None, write_tau=True):
        """
        Returns
        -------
        fig : matplotlib.figure.Figure
            Figure instance containing the plot.
        """
        check_is_fitted(self, 'neg_log_likelihood_')
        if ax is None:
            fig = plt.figure()
            ax = fig.gca()
        else:
            fig = ax.figure

        blue, green, red, purple, yellow, cyan = SEABORN_PALETTES['deep']

        i_best = np.nanargmin(self.neg_log_likelihood_)
        ax.plot(self.delays_ms_, self.neg_log_likelihood_, color=purple)
        ax.plot(self.delays_ms_[i_best], self.neg_log_likelihood_[i_best], 'D',
                color=red)
        ax.set_xlabel('Delay (ms)')
        ax.set_ylabel('Neg. log likelihood / T')
        ax.grid('on')

        if write_tau:
            ax.text(0.5, 0.80, r'$\mathrm{Estimated}$',
                    horizontalalignment='center', transform=ax.transAxes)
            ax.text(0.5, 0.66, r'$\tau_0 = %.0f \;\mathrm{ms}$' %
                    (self.delays_ms_[i_best], ), horizontalalignment='center',
                    transform=ax.transAxes)

        return fig
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号