Giter Site home page Giter Site logo

Comments (26)

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

net
attention-lstm and your old project's net

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

I am not sure what an attention-lstm is could you send a link?
I will start working on the CNN.

I need to implement/find a good implementation of convolution to use. (iI have written it myself before but it was very slow).

from blackcat_tensors.

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

about lstm-attention:
https://www.sciencedirect.com/science/article/abs/pii/S0950705119302400
https://www.sciencedirect.com/science/article/abs/pii/S1359431118343485
https://aclweb.org/anthology/D16-1058
https://arxiv.org/pdf/1908.02252.pdf
https://machinelearningmastery.com/how-does-attention-work-in-encoder-decoder-recurrent-neural-networks/
https://www.depends-on-the-definition.com/attention-lstm-relation-classification/
https://github.com/ningshixian/LSTM_Attention

from blackcat_tensors.

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

the Long Short Term Memory Fully Convolutional Network (LSTM-FCN) and Attention LSTM-FCN (ALSTM-FCN):

https://www.sciencedirect.com/science/article/pii/S0893608019301200?via%3Dihub
https://www.sciencedirect.com/science/article/pii/S0378437118314985?dgcid=raven_sd_recommender_email
https://www.sciencedirect.com/user/recommendations

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

Added CNN as of:

bbc1a2a

It is very slow, and the user must calculate the output-shape itself.
It is "experimental" currently but I will be completing within the next week.
(Improving performance, auto calculating shape, etc).

You can modify the example with this to test:
(I will add an example/tests etc soon).

	auto network = neuralnetwork(
		BC::nn::Convolution<System, double>(28,28,1, 7, 7, 3),
		BC::nn::flatten(system_tag, BC::shape(22, 22, 3)),
		BC::nn::logistic(system_tag, 22*22*3),
		BC::nn::feedforward(system_tag, 22*22*3, 256),
		BC::nn::logistic(system_tag, 256),
		BC::nn::feedforward(system_tag, 256, 10),
		BC::nn::softmax(system_tag, 10),
		BC::nn::logging_output_layer(system_tag, 10, BC::nn::RMSE).skip_every(100/5)
	);

	std::cout << " training..." << std::endl;
	auto start = std::chrono::system_clock::now();
	for (int i = 0; i < epochs; ++i){

		std::cout << " current epoch: " << i << std::endl;
		for (int j = 0; j < samples/batch_size; ++j) {
			network.forward_propagation(BC::reshape(inputs[j], BC::shape(28,28, 1, batch_size)));
			network.back_propagation(outputs[j]);
			network.update_weights();
		}
	}

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

TODO:

Improve implementation of CNN (most likely switch to img2col implementation).
Add Maxpooling
Add GPU Support.
Add auto-deduction of the shape.
Add Attention-LSTM

from blackcat_tensors.

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

you are so great.I expect it so much.

from blackcat_tensors.

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

How about Maxpooling,when use the cnn, shoud add Maxpooling? When I want try to use this truct model, how should i do?
图片

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

I have not yet implemented max-pooling, I want to try to optimize CNN first, but maxpooling isn't particularly difficult to implement so I can see if I can do that quickly.

from blackcat_tensors.

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

How about Maxpooling,when use the cnn, shoud add Maxpooling? When I want try to use this truct model, how should i do?
图片

How about this net struct, now can implement?

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

Yes I can work on that soon.
I am also working on optimizing LSTM and the Convolution Layer.

For Convolution and Maxpooling I may borrow Caffe's implementation.

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

You can see that I have started working on max-pooling here: https://github.com/josephjaspers/blackcat_tensors/blob/master/include/neural_networks/functions/Max_Pooling.h

from blackcat_tensors.

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

Yes. You are so great. I have seen the Max_Pooling.h, so i ask you that. Now we should first focus on the lstm single_predict, the same input and output, then to implement Convolution and Maxpooling.I expect it.

from blackcat_tensors.

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

Because i seen one paper, that net struct is efficient to make my forcast. Now only lstm layer the forcast result is not so good, we should make other net sturct or use the attention-lstm.But that is next to implement and test.

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

The order of things I will work on is...

  1. Optimizing Convolution (It is too slow)
  2. MaxPooling
  3. Optimizing LSTM (It can be much faster than the current implementation)
  4. AttentionLSTM
    I have found Caffe's implementation of Convoltution/MaxPooling so I will most likely be importing their implementation into this project.

from blackcat_tensors.

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

I am working on improving Convolution, hopefully I will have it finished by today or tomorrow.
I will try fix single_predict soon after.

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

Hi, I just added a new version of Convolution. (It still needs testing, does not support single-predict currently).

https://github.com/josephjaspers/blackcat_tensors/blob/master/include/neural_networks/Layers/Convolution_Experimental.h

However it should be much faster than the current version.
I will look into the single_predict function now.

Then...
--> Testing/adding single_predict to the faster Convolution method.
--> Max_Pooling
--> Optimizing LSTM
--> Adding Attention-LSTM

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

Because i seen one paper, that net struct is efficient to make my forcast. Now only lstm layer the forcast result is not so good, we should make other net sturct or use the attention-lstm.But that is next to implement and test.

I also just fixed a bug where set_learning_rate wouldn't actually set the learning_rate of the Layer. So perhaps re-running may improve performance.

from blackcat_tensors.

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

You are so great. I am so glad to see the updata. I will test the new code just right.So begin our work as you plan.

from blackcat_tensors.

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

Because i seen one paper, that net struct is efficient to make my forcast. Now only lstm layer the forcast result is not so good, we should make other net sturct or use the attention-lstm.But that is next to implement and test.

I also just fixed a bug where set_learning_rate wouldn't actually set the learning_rate of the Layer. So perhaps re-running may improve performance.

Yes, it is better in performance.But it need train more epochs:
befor version:
BC::nn::RMSE loss, begin is 0.156, i set epoch == 1028, then it reduce to 0.12, and have many mutations in the data.
now version:
BC::nn::RMSE loss, begin is 0.256, i set epoch == 5000, then it reduce to 0.07, and the data is relatively stable. When i set epoch == 1024, it only reduce to 0.166.

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

Eventually I would like to add optimizers (like momentum and Adam), though I havent begun to work on them yet.

from blackcat_tensors.

xinsuinizhuan avatar xinsuinizhuan commented on June 18, 2024

Eventually I would like to add optimizers (like momentum and Adam), though I havent begun to work on them yet.

I am glad to see your reply! I am so expected. I want to use the net in practical, so you should stepping up time, when you no busy, include the simgle_predict and up functions.

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

Convolution (the experimental version) is now the standard version.
I have tested it (not windows but on linux).
It is considerably faster than the previous version, however it consumes a lot of memory.

ff33dff

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

Maxpooling branch. (Not complete)

5e6602f

from blackcat_tensors.

josephjaspers avatar josephjaspers commented on June 18, 2024

convolution and maxpooling, have been added!
The attention-lstm ticket has been moved to:
#48

from blackcat_tensors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.