BuildYourOwnEmbedding is a Python library designed for generating synthetic neural responses and analysing their resultant embeddings. This library provides tools for modelling a variety of neural response functions, generating sets of synthetic responses, adding noise to the responses, and advanced analysis and evaluation techniques like PCA and RDMs.
To install the library, simply use pip:
pip install BuildYourOwnEmbeddingAlternatively, clone the repository and install the package:
git clone https://github.com/rates37/Build-Your-Own-Embedding.git
cd BuildYourOwnEmbedding
pip install .The following example demonstrates how to create a custom Gaussian response function:
import numpy as np
from BuildYourOwnEmbedding import responses, parameters
# Define input stimulus
x = np.linspace(0, 1, 100)
# Define response parameters
params = {
"mean": parameters.ConstantParameter(0.5),
"std": parameters.ConstantParameter(0.1)
}
# Create a Gaussian response manager
responseManager = responses.ResponseManager(responses.GaussianResponse, **params)
# Generate a neural response with no noise
neural_response = responseManager.generate_responses(x, noiseLevel=0)Full documentation is available here, including examples. You can generate the documentation locally using Sphinx:
cd docs
make htmlThis project welcomes contributions! To contribute to this project:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes and commit (
git commit -m 'Added Feature X'). - Push your branch (
git push origin feature-branch). - Create a pull request.
Please ensure that all new features are covered appropriately with tests and documentation.
This project is licensed under the MIT License. See the LICENSE file for details.