Skip to content

Commit

Permalink
some refactorings and rst-compliant readme
Browse files Browse the repository at this point in the history
  • Loading branch information
robintibor committed Jul 1, 2017
1 parent b75f320 commit af1d1a0
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 3 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
Note: The old braindecode repository has been moved to https://github.com/robintibor/braindevel.
Note: The old braindecode repository has been moved to
https://github.com/robintibor/braindevel.

Braindecode
===========

# Braindecode
A deep learning for raw time-domain EEG decoding toolbox.

Installation
============

Install pytorch from http://pytorch.org/.

Documentation
=============

Documentation is online under http://braindecode.readthedocs.io/
File renamed without changes.
20 changes: 20 additions & 0 deletions braindecode/datasets/signal_target.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class SignalAndTarget(object):
def __init__(self, X, y):
assert len(X) == len(y)
self.X = X
self.y = y


def apply_to_X_y(fn, *sets):
X = fn(*[s.X for s in sets])
y = fn(*[s.y for s in sets])
return SignalAndTarget(X,y)


def split_into_two_sets(dataset, fraction=None, n_boundary=None):
assert fraction is not None or n_boundary is not None
if n_boundary is None:
n_boundary = int(round(len(dataset.X) * fraction))
first_set = apply_to_X_y(lambda a: a[:n_boundary], dataset)
second_set = apply_to_X_y(lambda a: a[n_boundary:], dataset)
return first_set, second_set
1 change: 1 addition & 0 deletions braindecode/iterators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
from numpy.random import RandomState


def get_balanced_batches(n_trials, rng, shuffle, n_batches=None,
batch_size=None):
"""Create indices for batches balanced in size (batches will have maximum size difference of 1).
Expand Down
2 changes: 1 addition & 1 deletion braindecode/models/shallow_fbcsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from torch import nn
from torch.nn import init

from braindecode.modules.expression import Expression
from braindecode.torchext.modules import Expression
from braindecode.torchext.functions import safe_log, square
from braindecode.torchext.util import np_to_var

Expand Down
File renamed without changes.
61 changes: 61 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
from setuptools import setup # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path

here = path.abspath(path.dirname(__file__))

# Get the long description from the relevant file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()


setup(
name='Braindecode',

# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# http://packaging.python.org/en/latest/tutorial.html#version
version='0.1.1',

description='A deep learning for raw time-domain EEG decoding toolbox.',
long_description=long_description, #this is the

# The project's main homepage.
url='https://github.com/robintibor/braindecode',

# Author details
author='Robin Tibor Schirrmeister',
author_email='[email protected]',

# Choose your license
license='BSD 3-Clause',

install_requires=['numpy','mne'],
#tests_require = [...]

# See https://PyPI.python.org/PyPI?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 3 - Alpha',

# Indicate who your project is intended for
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
'Topic :: Software Development :: Build Tools',

"Topic :: Scientific/Engineering :: Artificial Intelligence",

# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: BSD License',

# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
],

# What does your project relate to?
keywords='eeg deep-learning brain-state-decoding',

packages=['braindecode'],

)

0 comments on commit af1d1a0

Please sign in to comment.