-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init docs by sphinx. * Update documentation theme to blue * add doc to README
- Loading branch information
Showing
18 changed files
with
318 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sphinx | ||
-e git://github.com/snide/sphinx_rtd_theme.git#egg=sphinx_rtd_theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
yews.datasets | ||
==================== | ||
|
||
All datasets are subclasses of :class:`torch.utils.data.Dataset` | ||
i.e, they have ``__getitem__`` and ``__len__`` methods implemented. | ||
Hence, they can all be passed to a :class:`torch.utils.data.DataLoader` | ||
which can load multiple samples parallelly using ``torch.multiprocessing`` workers. | ||
For example: :: | ||
|
||
waveform_data = yews.datasets.Folder('path/to/waveform_folder_root/') | ||
data_loader = torch.utils.data.DataLoader(waveform_data, | ||
batch_size=4, | ||
shuffle=True, | ||
num_workers=args.nThreads) | ||
|
||
The following datasets are available: | ||
|
||
.. contents:: Datasets | ||
:local: | ||
|
||
All the datasets have almost similar API. They all have two common arguments: | ||
``transform`` and ``target_transform`` to transform the input and target | ||
respectively. | ||
|
||
|
||
.. currentmodule:: yews.datasets | ||
|
||
|
||
DatasetArray | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. autoclass:: DatasetArray | ||
:members: __getitem__ | ||
:special-members: | ||
|
||
DatasetFolder | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. autoclass:: DatasetFolder | ||
:members: __getitem__ | ||
:special-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
yews.models | ||
=========== | ||
|
||
The models subpackage contains definitions for the following model | ||
architectures: | ||
|
||
.. contents:: Models | ||
:local: | ||
|
||
.. currentmodule:: yews.models | ||
|
||
CPIC | ||
---- | ||
|
||
.. autofunction:: cpic64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
yews.train | ||
---------- | ||
|
||
.. currentmodule:: yews.train | ||
|
||
.. autoclass:: Trainer | ||
:members: train, validate | ||
:special-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
yews.transforms | ||
====================== | ||
|
||
.. currentmodule:: yews.transforms | ||
|
||
Transforms are common waveform transformations. They can be chained together using :class:`Compose`. | ||
Additionally, there is the :mod:`yews.transforms.functional` module. | ||
Functional transforms give fine-grained control over the transformations. | ||
This is useful if you have to build a more complex transformation pipeline. | ||
|
||
.. autoclass:: Compose | ||
|
||
Transforms on Numpy Array | ||
------------------------- | ||
|
||
.. autoclass:: ZeroMean | ||
|
||
.. autoclass:: SoftClip | ||
|
||
.. autoclass:: CutWaveform | ||
|
||
Conversion Transforms | ||
--------------------- | ||
|
||
.. autoclass:: ToTensor | ||
:members: __call__ | ||
:special-members: | ||
|
||
Functional Transforms | ||
--------------------- | ||
|
||
Functional transforms give you fine-grained control of the transformation pipeline. | ||
As opposed to the transformations above, functional transforms don't contain a random number | ||
generator for their parameters. | ||
That means you have to specify/generate all parameters, but you can reuse the functional transform. | ||
For example, you can apply a functional transform to multiple images like this: | ||
|
||
TODO: need to replace the image example by a seismic waveform example below: | ||
|
||
.. code:: python | ||
import yews.transforms.functional as TF | ||
import random | ||
def my_segmentation_transforms(image, segmentation): | ||
if random.random() > 5: | ||
angle = random.randint(-30, 30) | ||
image = TF.rotate(image, angle) | ||
segmentation = TF.rotate(segmentation, angle) | ||
# more transforms ... | ||
return image, segmentation | ||
.. automodule:: yews.transforms.functional | ||
:members: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.