提交 4c5abcdc 编写于 作者: sahduashufa's avatar sahduashufa

conv_begin

上级 a7345407
{
"C_Cpp.errorSquiggles": "Disabled"
}
\ No newline at end of file
#include<iostream>
#include<ctime>
#include<string>
#include <time.h>
#include <math.h>
#include <fstream>
#include "./autodiff/node.h"
#include"./matrix/matrix_def.h"
#include"./matrix/matrix_pro.h"
#include"./welcome/score_wel.cpp"
#include"./logistic/logistic_def.h"
#include"./file_pro/data_read.h"
#include"./grad_edge/matrix_grad.h"
using namespace std;
clock_t start, stop;
double duration;
int main()
{
welcome();
cout_mat(conv_test(CreateRandMat(3,3),1,2));
return 0;
}
\ No newline at end of file
无法预览此类型文件
......@@ -19,7 +19,7 @@ Node t1 = 1,a13 = 1;
/*自定义的损失函数*/
Node loss_act(Node t1,Node a13)
{
Node loss = 0.5*(pow((t1-a13),2));
Node loss = 0.5*(pow((t1-a13),2));
return loss;
}
Node sigmoid_act(Node z)
......@@ -32,7 +32,7 @@ Node (*loss)(Node,Node) = loss_act;
Node (*act)(Node) = sigmoid_act;
int main()
{
//begin
//begin
cout<<"---------autodiff for neraul network-----------"<<endl;
Matrix data_mine = CreateMatrix(2,1);
cout<<"data mine"<<endl;
......@@ -65,4 +65,4 @@ int main()
cout<<"neraul end;"<<endl;
return 0;
}
}
}
\ No newline at end of file
#include<iostream>
#include<stdlib.h>
#include<string>
int main()
......@@ -341,4 +341,12 @@ Matrix get_row(Matrix mid1,int index)
}
return mid2;
}
Matrix conv_test(Matrix mid1,int stride = 1,int kernel_size = 3)
{
Matrix kernel = CreateRandMat(kernel_size,kernel_size);
cout_mat(kernel);
Matrix crop_pic = iloc(mid1,0,kernel.col,0,kernel.row);
Matrix result = mul(crop_pic,kernel);
return result;
}
#endif
#include <cstdio>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
fstream input_stream;
input_stream.open(".txt",ios::in);
char input[1000000];
int cnt=0;
if(input_stream.is_open()){
//cout<<"yes\n";
while(!input_stream.eof()){
input_stream.getline(input,999);
cout<<input<<endl;
}
}
input_stream.close();
}
\ No newline at end of file
___ _ __ _ ___ __ _ _
| __| __| | / _` | ___ o O O o O O o O O o O O o O O | __| _ _ / _` | (_) _ _ ___
| _| / _` | \__, | / -_) o o o o o | _| | ' \ \__, | | | | ' \ / -_)
|___| \__,_| |___/ \___| TS__[O] TS__[O] TS__[O] TS__[O] TS__[O] |___| |_||_| |___/ _|_|_ |_||_| \___|
_|"""""|_|"""""|_|"""""|_|"""""| {======| {======| {======| {======| {======|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|
"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'./o--000'./o--000'./o--000'./o--000'./o--000'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'
\ No newline at end of file
███████╗██████╗ ██████╗ ███████╗ ███████╗███╗ ██╗ ██████╗ ██╗███╗ ██╗███████╗
██╔════╝██╔══██╗██╔════╝ ██╔════╝ ██╔════╝████╗ ██║██╔════╝ ██║████╗ ██║██╔════╝
█████╗ ██║ ██║██║ ███╗█████╗ █████╗ ██╔██╗ ██║██║ ███╗██║██╔██╗ ██║█████╗
██╔══╝ ██║ ██║██║ ██║██╔══╝ ██╔══╝ ██║╚██╗██║██║ ██║██║██║╚██╗██║██╔══╝
███████╗██████╔╝╚██████╔╝███████╗ ███████╗██║ ╚████║╚██████╔╝██║██║ ╚████║███████╗
╚══════╝╚═════╝ ╚═════╝ ╚══════╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝╚═╝ ╚═══╝╚══════╝
\ No newline at end of file
// 44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
// 4444444444444444444444444444444444dddddddd44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
// EEEEEEEEEEEEEEEEEEEEEE444444444444d::::::d4444444444444444444444444444444444444444444444444444444EEEEEEEEEEEEEEEEEEEEEE4444444444444444444444444444444444444444iiii4444444444444444444444444444444444444444
// E::::::::::::::::::::E444444444444d::::::d4444444444444444444444444444444444444444444444444444444E::::::::::::::::::::E444444444444444444444444444444444444444i::::i444444444444444444444444444444444444444
// E::::::::::::::::::::E444444444444d::::::d4444444444444444444444444444444444444444444444444444444E::::::::::::::::::::E4444444444444444444444444444444444444444iiii4444444444444444444444444444444444444444
// EE::::::EEEEEEEEE::::E444444444444d:::::d44444444444444444444444444444444444444444444444444444444EE::::::EEEEEEEEE::::E444444444444444444444444444444444444444444444444444444444444444444444444444444444444
// 44E:::::E4444444EEEEEE4444ddddddddd:::::d4444ggggggggg444ggggg4444eeeeeeeeeeee444444444444444444444E:::::E4444444EEEEEEnnnn44nnnnnnnn4444444ggggggggg444gggggiiiiiii4nnnn44nnnnnnnn44444444eeeeeeeeeeee4444
// 44E:::::E444444444444444dd::::::::::::::d444g:::::::::ggg::::g44ee::::::::::::ee4444444444444444444E:::::E4444444444444n:::nn::::::::nn4444g:::::::::ggg::::gi:::::i4n:::nn::::::::nn4444ee::::::::::::ee44
// 44E::::::EEEEEEEEEE4444d::::::::::::::::d44g:::::::::::::::::g4e::::::eeeee:::::ee44444444444444444E::::::EEEEEEEEEE444n::::::::::::::nn44g:::::::::::::::::g4i::::i4n::::::::::::::nn44e::::::eeeee:::::ee
// 44E:::::::::::::::E444d:::::::ddddd:::::d4g::::::ggggg::::::gge::::::e44444e:::::e44444444444444444E:::::::::::::::E444nn:::::::::::::::ng::::::ggggg::::::gg4i::::i4nn:::::::::::::::ne::::::e44444e:::::e
// 44E:::::::::::::::E444d::::::d4444d:::::d4g:::::g44444g:::::g4e:::::::eeeee::::::e44444444444444444E:::::::::::::::E44444n:::::nnnn:::::ng:::::g44444g:::::g44i::::i444n:::::nnnn:::::ne:::::::eeeee::::::e
// 44E::::::EEEEEEEEEE444d:::::d44444d:::::d4g:::::g44444g:::::g4e:::::::::::::::::e444444444444444444E::::::EEEEEEEEEE44444n::::n4444n::::ng:::::g44444g:::::g44i::::i444n::::n4444n::::ne:::::::::::::::::e4
// 44E:::::E4444444444444d:::::d44444d:::::d4g:::::g44444g:::::g4e::::::eeeeeeeeeee4444444444444444444E:::::E444444444444444n::::n4444n::::ng:::::g44444g:::::g44i::::i444n::::n4444n::::ne::::::eeeeeeeeeee44
// 44E:::::E4444444EEEEEEd:::::d44444d:::::d4g::::::g4444g:::::g4e:::::::e4444444444444444444444444444E:::::E4444444EEEEEE44n::::n4444n::::ng::::::g4444g:::::g44i::::i444n::::n4444n::::ne:::::::e44444444444
// EE::::::EEEEEEEE:::::Ed::::::ddddd::::::ddg:::::::ggggg:::::g4e::::::::e4444444444444444444444444EE::::::EEEEEEEE:::::E44n::::n4444n::::ng:::::::ggggg:::::g4i::::::i44n::::n4444n::::ne::::::::e4444444444
// E::::::::::::::::::::E4d:::::::::::::::::d4g::::::::::::::::g44e::::::::eeeeeeee44444444444444444E::::::::::::::::::::E44n::::n4444n::::n4g::::::::::::::::g4i::::::i44n::::n4444n::::n4e::::::::eeeeeeee44
// E::::::::::::::::::::E44d:::::::::ddd::::d44gg::::::::::::::g444ee:::::::::::::e44444444444444444E::::::::::::::::::::E44n::::n4444n::::n44gg::::::::::::::g4i::::::i44n::::n4444n::::n44ee:::::::::::::e44
// EEEEEEEEEEEEEEEEEEEEEE444ddddddddd444ddddd4444gggggggg::::::g44444eeeeeeeeeeeeee44444444444444444EEEEEEEEEEEEEEEEEEEEEE44nnnnnn4444nnnnnn4444gggggggg::::::g4iiiiiiii44nnnnnn4444nnnnnn4444eeeeeeeeeeeeee44
// 444444444444444444444444444444444444444444444444444444g:::::g4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444g:::::g44444444444444444444444444444444444444444444444
// 444444444444444444444444444444444444444444gggggg444444g:::::g4444444444444444444444444444444444444444444444444444444444444444444444444444gggggg444444g:::::g44444444444444444444444444444444444444444444444
// 444444444444444444444444444444444444444444g:::::gg444gg:::::g4444444444444444444444444444444444444444444444444444444444444444444444444444g:::::gg444gg:::::g44444444444444444444444444444444444444444444444
// 4444444444444444444444444444444444444444444g::::::ggg:::::::g44444444444444444444444444444444444444444444444444444444444444444444444444444g::::::ggg:::::::g44444444444444444444444444444444444444444444444
// 44444444444444444444444444444444444444444444gg:::::::::::::g4444444444444444444444444444444444444444444444444444444444444444444444444444444gg:::::::::::::g444444444444444444444444444444444444444444444444
// 4444444444444444444444444444444444444444444444ggg::::::ggg44444444444444444444444444444444444444444444444444444444444444444444444444444444444ggg::::::ggg44444444444444444444444444444444444444444444444444
// 4444444444444444444444444444444444444444444444444gggggg44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444gggggg44444444444444444444444444444444444444444444444444444
______ _ ______ _
| ____| | | | ____| (_)
| |__ __| | __ _ ___ | |__ _ __ __ _ _ _ __ ___
| __| / _` |/ _` |/ _ \ | __| | '_ \ / _` | | '_ \ / _ \
| |___| (_| | (_| | __/ | |____| | | | (_| | | | | | __/
|______\__,_|\__, |\___| |______|_| |_|\__, |_|_| |_|\___|
__/ | __/ |
|___/ |___/
文件已添加
#include<iostream>
#include<string>
#include <cstdio>
#include <iostream>
#include <fstream>
#include <string>
#include<stdlib.h>
#define random(x) (rand()%x)
using namespace std;
int welcome(){
cout<<"----------";
cout<<"Hello This is Edge"<<"----------"<<endl;
fstream input_stream;
const char* candidates[] = {"./welcome/2.txt","./welcome/3.txt","./welcome/big.txt"};
srand((unsigned int)time(NULL));
input_stream.open(candidates[rand()%3],ios::in);
cout<<"new"<<input_stream.is_open()<<endl;
char input[1000000];
int cnt=0;
if(input_stream.is_open()){
cout<<"yes\n";
while(!input_stream.eof()){
input_stream.getline(input,999);
cout<<input<<endl;
}
}
input_stream.close();
return 0;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册