josephjaspers / blackcat_tensors

Matrix-Vector Library Designed for Neural Network Construction. cuda (gpu) support, openmp (multithreaded cpu) support, partial support of BLAS, expression template based implementation PTX code generation identical to hand written kernels, and support for auto-differentiation
12 stars 4 forks source link

new error, struct std::move error: #64

Open xinsuinizhuan opened 4 years ago

xinsuinizhuan commented 4 years ago

My struct,it does not supprot: m_pnetwork = std::move, now: auto make_lstm_network() { return bc::nn::neuralnetwork( bc::nn::lstm(bc::host_tag(), 96 * 10, 1024, bc::nn::adam), bc::nn::lstm(bc::host_tag(), 1024, 512, bc::nn::adam), bc::nn::lstm(bc::host_tag(), 512, 216, bc::nn::adam), bc::nn::feedforward(bc::host_tag(), 216, 192), bc::nn::logistic(bc::host_tag(), 192), bc::nn::logging_output_layer(bc::host_tag(), 192, bc::nn::RMSE).skip_every(100) ); } using network_type = decltype(make_lstm_network());

typedef struct _LstmPredictTask { int m_batch_size;
double m_learning_rate;
network_type m_pnetwork = make_lstm_network();
void reset_neural_network() { m_pnetwork = std::move(make_lstm_network()); } } LstmPredictTask; error: 图片

josephjaspers commented 4 years ago

Sorry for not replying recently, I have a lot more time so I will be trying to fix all of these soon!

josephjaspers commented 4 years ago

Just an update:

I am currently working on the project though I am splitting my time between two projects now: https://github.com/josephjaspers/Robinhood

I am currently working on a redesign of some parts of the Tensor, and later the neural network. I imagine this will take some time. I was able to get the above code to compile on linux.

I am going to try and get a virtual machine for Windows so I can more consistently test changes on windows.

Thanks for your patience.

xinsuinizhuan commented 4 years ago

Oh, No. The two problem is also error. 1、in feedforward.h file: 图片 if i use the value_type like above for feedforward code, it is ok: template<class SystemTag, class Optimizer = nn_default_optimizer_type> auto feedforward(int inputs, int outputs, Optimizer=Optimizer()) { using system_tag = BLACKCAT_DEFAULT_SYSTEM_T; using value_type = typename SystemTag::default_floating_point_type; return FeedForward<system_tag, value_type, Optimizer>(inputs, outputs); }

2、it still don't support : m_pnetwork = std::move, now: 图片

josephjaspers commented 4 years ago

(Hopefully) fixed as of https://github.com/josephjaspers/blackcat_tensors/commit/e7bfd8d16d8584511a6529abb47b250e911b8431

Made some other changes to remove most warnings as well.

xinsuinizhuan commented 4 years ago

(Hopefully) fixed as of e7bfd8d

Made some other changes to remove most warnings as well.

still not support m_pnetwork = std::move(make_lstm_network()): auto make_lstm_network() { return bc::nn::neuralnetwork( bc::nn::lstm(bc::host_tag(), 96 * 10, 1024, bc::nn::adam), bc::nn::lstm(bc::host_tag(), 1024, 512, bc::nn::adam), bc::nn::lstm(bc::host_tag(), 512, 216, bc::nn::adam), bc::nn::feedforward(bc::host_tag(), 216, 192), bc::nn::logistic(bc::host_tag(), 192), bc::nn::logging_output_layer(bc::host_tag(), 192, bc::nn::RMSE).skip_every(100) ); } using network_type = decltype(make_lstm_network());

typedef struct _LstmPredictTask { network_type m_pnetwork = make_lstm_network(); //检测网络Net void reset_neural_network() { m_pnetwork = std::move(make_lstm_network()); } } LstmPredictTask; std::move(make_lstm_network()) can not assign to m_pnetwork

图片

josephjaspers commented 4 years ago

I was able to replicate the error and have fixed it here: https://github.com/josephjaspers/blackcat_tensors/commit/6f8f7032f7b0cc63336800e1b746521cb2c7d8e8

I've added some tests to cover this bug as well!