Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #976 from vilyaair/Agg
Avoid to import matplotlib to set its backend Agg in code like chainer
- Loading branch information
Showing
6 changed files
with
45 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# GMM example | ||
|
||
This example contains implementation of Gaussian Mixture Model (GMM). | ||
|
||
|
||
### How to demo | ||
The demo contains a script that partitions data into groups using Gaussian Mixture Model. | ||
The demo can be run by the following command. | ||
|
||
``` | ||
python gmm.py [--gpu-id GPU_ID] [--num NUM] [--dim DIM] | ||
[--max-iter MAX_ITER] [--tol TOL] [--output-image OUTPUT] | ||
``` | ||
|
||
If you run this script on environment without matplotlib renderers (e.g., non-GUI environment), setting the environmental variable `MPLBACKEND` to `Agg` may be required to use `matplotlib`. For example, | ||
|
||
``` | ||
MPLBACKEND=Agg python gmm.py ... | ||
``` |
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,20 @@ | ||
# kmeans example | ||
|
||
This example contains implementation of K-means clustering. | ||
|
||
|
||
### How to demo | ||
The demo contains a script that partitions data into groups using K-means clustering. | ||
The demo can be run by the following command. | ||
|
||
``` | ||
python kmeans.py [--gpu-id GPU_ID] [--n-clusters N_CLUSTERS] [--num NUM] | ||
[--max-iter MAX_ITER] [--use-custom-kernel] | ||
[--output-image OUTPUT_IMAGE] | ||
``` | ||
|
||
If you run this script on environment without matplotlib renderers (e.g., non-GUI environment), setting the environmental variable `MPLBACKEND` to `Agg` may be required to use `matplotlib`. For example, | ||
|
||
``` | ||
MPLBACKEND=Agg python kmeans.py ... | ||
``` |
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