什么是Polygon马蹄链matic系统开发丨Polygon马蹄链matic系统开发(逻辑及方案)源码版
Participation in blockchain and other technologies.Blockchain is the most prominent key technology in Web 3.0,helping secure,transparent,and tamper-proof transactions.Web3.0 also includes other mechanisms to promote and promote decentralization,such as cloud computing,AR Cloud,and other key technologies in cyberspace;
如何使用Polygon
Polygon是建立Ethereum的区块链互联网。简而言之,Polygon提供了一个通用的框架,允许开发人员创建定制的、特定于应用的链,利用Ethereum的安全性,提供一个可互操作的网络,将各种不同的扩展解决方案联系在一起,如Zk-rollups、optimistic-rollups和侧链。
import torch.nn as nn
class CNN(nn.Module):
def __init__(self):
关于区块链项目技术开发唯:MrsFu123,代币发行、dapp智能合约开发、链游开发、多链钱包开发
交易所开发、量化合约开发、互助游戏开发、Nft数字藏品开发、众筹互助开发、元宇宙开发、swap开发、
链上合约开发、ido开发、商城开发等,开发过各种各样的系统模式,更有多种模式、制度、案例、后台等,成熟技术团队,欢迎实体参考。
super(CNN,self).__init__()
self.conv1=nn.Sequential(
nn.Conv2d(in_channels=1,out_channels=16,kernel_size=(3,3),stride=(1,1),padding=1),
nn.ReLU(),
nn.MaxPool2d(kernel_size=2)#for 28*28 to 14*14
)
self.conv2=nn.Sequential(
nn.Conv2d(in_channels=16,out_channels=32,kernel_size=(3,3),stride=(1,1),padding=1),
nn.ReLU(),开发技术详细I35功能7O98设计O7I8
nn.MaxPool2d(kernel_size=2)#for 14*14 to 7*7
)
self.output=nn.Linear(32*7*7,10)
def forward(self,x):
out=self.conv1(x)
#load model
print('load cnn model','n')
cnn_=torch.load('cnn.pt')
#test new data
test_output=cnn_(test_over_x)
predict_y=torch.max(test_output,1)[1].data.numpy()
print("prediction number:{}".format(predict_y))
print("real number:{}".format(test_over_y.numpy()),'n')
accuracy=float((predict_y==test_over_y.data.numpy()).astype(int).sum())/float(test_over_y.size(0))
print("accuracy:{}".format(accuracy),'n')
out=self.conv2(out)
out=out.view(out.size(0),-1)#flatten the 32*7*7 dimension to 1568
out=self.output(out)
return out