导入 scipy.special.expit 时出错 [英] Error importing scipy.special.expit

查看:43
本文介绍了导入 scipy.special.expit 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想导入 scipy.special.expit 中可用的 sigmoid 函数.

I want to import the sigmoid function available at scipy.special.expit.

如果我使用 import scipy.special.expit as sigmoid(或不使用as sigmoid"),我会收到No module called expit"错误.

If I use import scipy.special.expit as sigmoid (or without the "as sigmoid") I get a "No module called expit" error.

如果我使用 from scipy import special,那么使用 special.expit(N) 有效.

If I use from scipy import special, then using special.expit(N) works.

如果我使用 from scipy import special.expit as sigmoidspecial.expit(点)处的语法无效.

If I use from scipy import special.expit as sigmoid, invalid syntax at special.expit (the dot).

如果我使用 from scipy.special import expitspecial 不是定义错误.

If I use from scipy.special import expit, special is not defined error.

那么……我到底怎么才能导入分配sigmoid"别名的expit函数?

So... how the hell can I import the expitfunction assigning the "sigmoid" alias?

推荐答案

正如我在评论中指出的,

As I noted in a comment,

from scipy.special import expit

应该可以.要导入名称为 sigmoidexpit,请使用

should work. To import expit with the name sigmoid, use

from scipy.special import expit as sigmoid

这篇关于导入 scipy.special.expit 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆