当前位置:网站首页>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
边栏推荐
- 306. Addenda
- Summarized benefits
- MySQL的意向共享锁、意向排它锁和死锁
- [daily training] 513 Find the value in the lower left corner of the tree
- 406-双指针(27. 移除元素、977.有序数组的平方、15. 三数之和、18. 四数之和)
- 303. region and retrieval - array immutable
- Idea installing the cloudtoolkit plug-in
- 309. 最佳买卖股票时机含冷冻期
- 896. 单调数列
- 云原生落地进入深水区,博云容器云产品族释放四大价值
猜你喜欢

MySQL optimization

Idea installing the cloudtoolkit plug-in

Some difficulties in making web pages

MySQL的意向共享锁、意向排它锁和死锁

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

MySQL重做日志 redo log

MySQL mvcc multi version concurrency control

WPF command directive and inotifypropertychanged
![[project training] multi segment line expanded to parallel line](/img/f2/ee4985fd2454bf00d600e34a818f2d.png)
[project training] multi segment line expanded to parallel line

Badly placed()'s problem
随机推荐
System permission program cannot access SD card
898. subarray bitwise OR operation
Some difficulties in making web pages
Regular expression graph and text ultra detailed summary without rote memorization (Part 1)
313. super ugly number
Using fuser to view file usage
JS dynamically creates a href circular download file. Only 10 or a fixed number of files can be downloaded
How to verify date format in PHP (regular)
Swagger3 integrates oauth2 authentication token
Don't look for [12 super easy-to-use Google plug-ins are here] (are you sure you want to take a look?)
MySQL MVCC多版本并发控制
js 判断两个数组增加和减少的元素
Xiaobai must see in investment and wealth management: illustrated fund buying and selling rules
Analyzing the creation principle in maker Education
295. 数据流的中位数
Detailed explanation of callback function
About Supervision
MySQL mvcc multi version concurrency control
[bull Chinese document] queue package used to process distributed jobs and messages in nodejs
[STL] summary of map usage of associated containers