callable函数 stride的意义 Math.round(),Math.ceil(),Math.floor()用法
生活随笔
收集整理的這篇文章主要介紹了
callable函数 stride的意义 Math.round(),Math.ceil(),Math.floor()用法
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
callable()函數(shù)檢查一個(gè)函數(shù)是否可以調(diào)用
如果返回True,object仍然可能調(diào)用失敗;但如果返回False,調(diào)用對(duì)象ojbect絕對(duì)不會(huì)成功。
對(duì)于函數(shù), 方法, lambda 函式, 類, 以及實(shí)現(xiàn)了?__call__?方法的類實(shí)例, 它都返回 True。
callable(object)stride
卷積中的步幅是另一個(gè)構(gòu)建卷積神經(jīng)網(wǎng)絡(luò)的基本操作
將藍(lán)色框移動(dòng)兩個(gè)步長(zhǎng),你將會(huì)得到83的結(jié)果。當(dāng)你移動(dòng)到下一行的時(shí)候,你也是使用步長(zhǎng)2而不是步長(zhǎng)1,所以我們將藍(lán)色框移動(dòng)到這里:
?
1.Math.round():根據(jù)“round”的字面意思“附近、周圍”,可以猜測(cè)該函數(shù)是求一個(gè)附近的整數(shù),看下面幾個(gè)例子就明白。
小數(shù)點(diǎn)后第一位<5 正數(shù):Math.round(11.46)=11 負(fù)數(shù):Math.round(-11.46)=-11 小數(shù)點(diǎn)后第一位>5 正數(shù):Math.round(11.68)=12 負(fù)數(shù):Math.round(-11.68)=-12 小數(shù)點(diǎn)后第一位=5 正數(shù):Math.round(11.5)=12 負(fù)數(shù):Math.round(-11.5)=-11 總結(jié):(小數(shù)點(diǎn)后第一位)大于五全部加,等于五正數(shù)加,小于五全不加。 2.Math.ceil():根據(jù)“ceil”的字面意思“天花板”去理解; 例如: Math.ceil(11.46)=Math.ceil(11.68)=Math.ceil(11.5)=12 Math.ceil(-11.46)=Math.ceil(-11.68)=Math.ceil(-11.5)=-11 3.Math.floor():根據(jù)“floor”的字面意思“地板”去理解; 例如: Math.ceil(11.46)=Math.ceil(11.68)=Math.ceil(11.5)=11 Math.ceil(-11.46)=Math.ceil(-11.68)=Math.ceil(-11.5)=-12 參考:https://www.cnblogs.com/johnsonwei/p/6101171.html轉(zhuǎn)載于:https://www.cnblogs.com/lucky466/p/10250390.html
總結(jié)
以上是生活随笔為你收集整理的callable函数 stride的意义 Math.round(),Math.ceil(),Math.floor()用法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Datawhale编程——动态规划DP
- 下一篇: 高效开发 Dubbo?用 Spring