当前位置:网站首页>PSP code implementation
PSP code implementation
2022-06-23 07:11:00 【Houston pineapple】
principle :
Backbone+PSP+Prediction
Realization :
# Code reference official
import paddle.fluid as fluid
import numpy as np
np.set_printoptions(precision=2)
x = [ [0.14,0.8,0.34,0.2,0.004,0.31,0.34,0.11],
[0.69,0.51,0.35,0.11,0.22,0.47,0.39,0.92],
[0.64,0.77,0.41,0.08,0.86,0.61,0.41,0.6],
[0.35,0.9,0.07,0.92,0.16,0.78,0.17,0.87],
[0.95,0.44,0.15,0.53,0.89,0.38,0.51,0.08],
[0.93,0.64,0.83,0.37,0.56,0.37,0.68,0.66],
[0.37,0.01,0.58,0.2,0.81,0.75,0.05,0.15],
[0.08,0.66,0.63,0.25,0.18,0.67,0.97,0.34]]
def main():
global x
with fluid.dygraph.guard(fluid.CPUPlace()):
x = np.array(x)
print(x.shape)
print(x)
x = x[np.newaxis,np.newaxis,:,:]
x = fluid.dygraph.to_variable(x)
y = fluid.layers.adaptive_pool2d(input=x,pool_size=[5,3],pool_type='max')
y = y.numpy().squeeze((0,1))
print(y.shape)
print(y)
if __name__ == "__main__":
main()
effect
边栏推荐
- C language operator priority formula
- 1161 Merging Linked Lists
- Quartz调度框架的学习使用
- 【STL】关联容器之map用法总结
- 407 stack and queue (232. implementing queue with stack, 225. implementing stack with queue)
- 直播回顾 | 传统应用进行容器化改造,如何既快又稳?
- 406-双指针(27. 移除元素、977.有序数组的平方、15. 三数之和、18. 四数之和)
- 315. calculate the number of elements on the right that are smaller than the current element
- A small method of debugging equipment serial port information with ADB
- 312. 戳气球
猜你喜欢

Intentional shared lock, intentional exclusive lock and deadlock of MySQL

407-栈与队列(232.用栈实现队列、225. 用队列实现栈)

MySQL重做日志 redo log

100 GIS practical application cases (79) - key points of making multi plan integrated base map
![[daily training] 513 Find the value in the lower left corner of the tree](/img/97/ab2179d6dbd0536e8cc139659aecc2.png)
[daily training] 513 Find the value in the lower left corner of the tree

深度学习系列47:styleGAN总结

js 判断两个数组增加和减少的元素

Interpreting the spirit of unity and cooperation in maker Education

Eureka

【BULL中文文档】用于在 NodeJS 中处理分布式作业和消息的队列包
随机推荐
Interpreting the spirit of unity and cooperation in maker Education
Idea installing the cloudtoolkit plug-in
898. subarray bitwise OR operation
306. Addenda
[project training] change of linear arrow
Summarized benefits
Some difficulties in making web pages
406 double pointer (27. remove elements, 977. square of ordered array, 15. sum of three numbers, 18. sum of four numbers)
407 stack and queue (232. implementing queue with stack, 225. implementing stack with queue)
Specific help of OSI layered model to work
Using fuser to view file usage
900. RLE 迭代器
313. 超级丑数
RFID数据安全性实验:C#可视化实现奇偶校验、CRC冗余校验、海明码校验
MySQL的意向共享锁、意向排它锁和死锁
EndNote20使用教程分享(未完
如何达到高效的网络信息传播
MySQL redo log redo log
[system] right click the desktop icon. After turning around, the Explorer will crash and the desktop will be refreshed
900. RLE iterator