Body: <p>Let's have a set of n devices firing signals. Devices are firing in the same cycles, but each device can fire in different phase of the cycle. More, the exact firing point can fluctuate, for example 20%
  off the phase to both sides.</p>
  <p><a href="https://i.sstatic.net/f9aeV.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/f9aeV.png" alt="visualisation of firings in the cycle" /></a></p>
  <p>For me, this repeated firings can be seen like some kind of time-based pattern.</p>
  <p>The main goal is to <strong>detect if some device changed it's phase</strong>, so the timings in the pattern are changed.</p>
  <p>I generated dataset with rows for each second. On each row there is actual time and  another n-1 columns representing difference between firing time of this device and first device.</p>
  <p>Example: let's have 4 devices - D0 to D3. t1 means difference of firing times between D1 and D0.</p>
  <pre><code>time     t1 t2 t3
  13:00:00  5  2  7
  </code></pre>
  <p>That means that D1 fired 5s after D0, D2 fired 5+2s after D0 and D3 fired 5+2+7s after D0.</p>
  <p>Also there can be negative numbers since the allowed fluctuation - the D2 could fired earlier than D0.</p>
  <p>To amateur me this seems that this numbers create patterns that some kind of NN should be able to learn and filter out the noise.</p>
  <p>My questions:</p>
  <ul>
  <li>which kind of network should I use? I tried to do simple feed forward network and do a classification, but since I am generating the dataset, I have <strong>no negative data</strong> and I so I am unable to categorize it.</li>
  <li>is this kind of dataset a good approach, or should I use other properties?</li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-16T10:24:36.973Z
Comments.Text: Why don't you generate negative data? What makes negative data in this case negative?
Comments.UserDisplayName: tnfru
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-16T10:27:05.583Z
Comments.Text: The negative data is with at least one device fires out of phase (accounting the fluctuation), disrupting the pattern of firings in the cycle. It is not easy to generate that firing randomness using same tool that generates the correctly timed pulses.
Comments.UserDisplayName: Tom HANAX
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-16T10:30:57.380Z
Comments.Text: If there are no negative examples, the neural network will always predict yes because it is always true. You very likely need to find a way to generate negative samples.
Comments.UserDisplayName: tnfru
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-16T10:35:52.523Z
Comments.Text: Taking that I am unable to generate negative samples (for now), is there any other approach? I tried feed the data as time series (one row for every pulse) and set the lag of the window to number of devices. I've trained the network and got some results, but they are not satisfactory - the prediction of the next element is sometimes a way off.
Comments.UserDisplayName: Tom HANAX
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-16T10:40:20.657Z
Comments.Text: Yes you can formulate it as a time series problem, which makes more sense. The problem without negative samples still exist. You can try predicting the next element instead of classifying if the phase changed. If you're interested in this I can formulate an answer on that basis.
Comments.UserDisplayName: tnfru
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-16T11:01:50.940Z
Comments.Text: Yes, my classification was: if the prediction is close enough to real firing time, than the device is in phase. But the predictions were off sometimes. Yes I am interested in any correct solution :) I am using encog-java library if that matters.
Comments.UserDisplayName: Tom HANAX
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-16T11:04:45.803Z
Comments.Text: I'm not sure if the way you classify will work out. You're inducing a really big bias - after consideration I don't think my proposed methodology (RL or transformer) will solve your issue.
Comments.UserDisplayName: tnfru
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-21T14:30:04.017Z
Comments.Text: I can't really understand the real problem here. I believe you don't even need to use Machine Learning here. Please try to include a sample of the real input and the output expected, so I can help you further.
Comments.UserDisplayName: Andre Goulart
Tags: <neural-networks><pattern-recognition>
Title: How to build neural network that detects changed signal firing pattern and is trained on positive patterns only?
UserDisplayName: Tom HANAX
ThreadText: # How to build neural network that detects changed signal firing pattern and is trained on positive patterns only?
  
  (Asked by: username_0 on 2021-09-13)
  
  Let's have a set of n devices firing signals. Devices are firing in the same cycles, but each device can fire in different phase of the cycle. More, the exact firing point can fluctuate, for example 20%
  off the phase to both sides.
  
  [![visualisation of firings in the cycle](https://i.sstatic.net/f9aeV.png)](https://i.sstatic.net/f9aeV.png)
  
  For me, this repeated firings can be seen like some kind of time-based pattern.
  
  The main goal is to **detect if some device changed it's phase**, so the timings in the pattern are changed.
  
  I generated dataset with rows for each second. On each row there is actual time and another n-1 columns representing difference between firing time of this device and first device.
  
  Example: let's have 4 devices - D0 to D3. t1 means difference of firing times between D1 and D0.
  
  ```
  time     t1 t2 t3
  13:00:00  5  2  7
  
  ```
  
  That means that D1 fired 5s after D0, D2 fired 5+2s after D0 and D3 fired 5+2+7s after D0.
  
  Also there can be negative numbers since the allowed fluctuation - the D2 could fired earlier than D0.
  
  To amateur me this seems that this numbers create patterns that some kind of NN should be able to learn and filter out the noise.
  
  My questions:
  
  * which kind of network should I use? I tried to do simple feed forward network and do a classification, but since I am generating the dataset, I have **no negative data** and I so I am unable to categorize it.
  * is this kind of dataset a good approach, or should I use other properties?
  
  **Tags:** neural-networks, pattern-recognition
  
  > **Comments:**
  > **username_1**: Why don't you generate negative data? What makes negative data in this case negative?  
  > **username_0**: The negative data is with at least one device fires out of phase (accounting the fluctuation), disrupting the pattern of firings in the cycle. It is not easy to generate that firing randomness using same tool that generates the correctly timed pulses.  
  > **username_1**: If there are no negative examples, the neural network will always predict yes because it is always true. You very likely need to find a way to generate negative samples.  
  > **username_0**: Taking that I am unable to generate negative samples (for now), is there any other approach? I tried feed the data as time series (one row for every pulse) and set the lag of the window to number of devices. I've trained the network and got some results, but they are not satisfactory - the prediction of the next element is sometimes a way off.  
  > **username_1**: Yes you can formulate it as a time series problem, which makes more sense. The problem without negative samples still exist. You can try predicting the next element instead of classifying if the phase changed. If you're interested in this I can formulate an answer on that basis.  
  > **username_0**: Yes, my classification was: if the prediction is close enough to real firing time, than the device is in phase. But the predictions were off sometimes. Yes I am interested in any correct solution :) I am using encog-java library if that matters.  
  > **username_1**: I'm not sure if the way you classify will work out. You're inducing a really big bias - after consideration I don't think my proposed methodology (RL or transformer) will solve your issue.  
  > **username_2**: I can't really understand the real problem here. I believe you don't even need to use Machine Learning here. Please try to include a sample of the real input and the output expected, so I can help you further.  
  
  ---
  
  ## 0 answers
  
  