• 2023-11-18囚徒4.0_mnist应用
    #囚徒mnist应用importsys,ossys.path.append(r"E:\mytools\vscode_subject\vscode\python\cnn\deep_network")#为了导入父目录的文件而进行的设定importnumpyasnpimportpicklefromdataset.mnistimportload_mnistfromcommon.functionsimportsigmoid,softmax
  • 2023-11-18囚徒_mnist
    #囚徒mnisttry:importurllib.requestexceptImportError:raiseImportError('YoushouldusePython3.x')fromastimportNotimportos.pathimportgzipimportpickleimportosimportnumpyasnpurl_base='http://yann.lecun.com/exdb/mnist/&
  • 2023-11-18囚徒4.0_12
    #囚徒4.0_12importnumpyasnpdefAND(x1,x2):x=np.array([x1,x2])w=np.array([0.5,0.5])b=-0.7temp=np.sum(x*w)+biftemp>0:return1else:return0defOR(x1,x2):x=np.array([x1,x2])w=np.array([1,1])b=-0.5temp=np.sum(x*w)+biftemp>0:return1e
  • 2023-11-18囚徒_风云云检测算法改进
    functionmask=code(ref_b2,ref_b3,ref_b4,ref_b5,tmp_7,tmp_9,tmp_13,tmp_15,SC,height,mask_lan)%算法实现%此处提供详细说明sz=size(ref_b2);temp=ref_b4*0;temp(temp~=-999.0)=1;raio=ref_b3./ref_b2;%可信矩阵准备mat_15=T_mat(tmp_15,224,228,"lt");mat_9=T_m
  • 2023-11-18囚徒4.0_13_梯度
    囚徒4.0_13_梯度这是是关于求取梯度的#coding:utf-8importnumpyasnpimportmatplotlib.pylabaspltfrommpl_toolkits.mplot3dimportAxes3D#非批处理梯度求取(1,2)(x1,x2)def_numerical_gradient_no_batch(f,x):h=1e-4#0.0001grad=np.zeros_like(x)#对x进
  • 2023-11-18囚徒4.1_12_数值微分近似
    数值微分近似#囚徒4.0_13_数值微分近似importnumpyasnpimportmatplotlib.pylabasplt#求数值微分导数defnumerical_diff(f,x):h=1e-4#0.0001return(f(x+h)-f(x-h))/(2*h)#函数deffunction_1(x):return0.01*x**2+0.1*xdeftangent_line(f,x):d