how do i generate samples of two input xor gate for neural networks

 Accepted Answer

You mean 32 examples (a single sample is a set of multiple examples).
There are only 4 possible inputs. They are obvious.
Hope this helps.
Thank you for formally accepting my answer
Greg

4 Comments

To simulate NN training of the XOR function, two input signals with 32 binary samples were used to estimate the magnitude of the signals traversing through the NN. The data were divided into three segments; with 24 samples for training (75%), four samples (15%) for validation leaving four samples (15%) for testing
I don't understand.
1. There are only 4 possible input combinations.
2. round(0.15*32) = 5 => 22/5/5
75% + 15% + 15%... I'll assume a typo
Then it is not clear what you are asking - the question you posed is asking how to generate samples you now say you have done!

Sign in to comment.

More Answers (1)

To generate a "random" binary sequence check out this similar thread! http://www.mathworks.co.uk/matlabcentral/answers/114656-random-binary-sequence-generator. You need to do it twice (one per input) and specify the number number of samples in each sequence (32). I hope this is helpful.

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!