Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Generation and Parser from OpenGPT #97

Open
jfResearchEng opened this issue Dec 16, 2022 · 0 comments · May be fixed by #103
Open

Data Generation and Parser from OpenGPT #97

jfResearchEng opened this issue Dec 16, 2022 · 0 comments · May be fixed by #103

Comments

@jfResearchEng
Copy link
Contributor

jfResearchEng commented Dec 16, 2022

🚀 Feature

Generate data set for training using opengpt. And also create a parser to separate the coded from the context.

The starting points would be filtering techniques: e.g. Kalman Filter and IIR filter.

Convert:

An infinite impulse response (IIR) filter is a type of digital filter that can be used to implement a variety of different frequency response characteristics. It is characterized by its recursive structure, which allows it to have an impulse response that extends indefinitely into the past. Here is some sample code that demonstrates how to implement an IIR filter using a direct form II structure:

import numpy as np

class IIRFilter:
    def __init__(self, b, a):
        self.b = b
        self.a = a
        self.z = np.zeros(max(len(b), len(a)))

    def filter(self, x):
        y = np.zeros_like(x)
        for n in range(len(x)):
            y[n] = self.b[0] * x[n]
            for m in range(1, len(self.b)):
                if n-m >= 0:
                    y[n] += self.b[m] * x[n-m]
            for m in range(1, len(self.a)):
                if n-m >= 0:
                    y[n] -= self.a[m] * y[n-m]
            self.z[0] = x[n]
            self.z[1:] = self.z[:-1]
        return y

to
result[0] = "An infinite impulse response (IIR) filter is a type of digital filter that can be used to implement a variety of different frequency response characteristics. It is characterized by its recursive structure, which allows it to have an impulse response that extends indefinitely into the past. Here is some sample code that demonstrates how to implement an IIR filter using a direct form II structure:"

result[1] =

import numpy as np

class IIRFilter:
    def __init__(self, b, a):
        self.b = b
        self.a = a
        self.z = np.zeros(max(len(b), len(a)))

    def filter(self, x):
        y = np.zeros_like(x)
        for n in range(len(x)):
            y[n] = self.b[0] * x[n]
            for m in range(1, len(self.b)):
                if n-m >= 0:
                    y[n] += self.b[m] * x[n-m]
            for m in range(1, len(self.a)):
                if n-m >= 0:
                    y[n] -= self.a[m] * y[n-m]
            self.z[0] = x[n]
            self.z[1:] = self.z[:-1]
        return y

The example above is a transformer node.

For this issue, we would like to prioritize the following nodes (priority high to low):

  1. Transformer Node (e.g. IIRFilter)
  2. Source Node (e.g. Microphone integration)
  3. UI (e.g. Matplotlib-based plotting)

Additional context

  1. The code should be added at folder is https://github.com/facebookresearch/labgraph/tree/main/extensions/lgpilot
  2. Create setup.py and README.md, where example can be found at: https://github.com/facebookresearch/labgraph/tree/main/extensions/labgraph_viz
  3. Add github action support, reference: https://github.com/facebookresearch/labgraph/actions/workflows/main.yml
  4. Add proper license header.
@maitnngo2002 maitnngo2002 linked a pull request Feb 25, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant