summaryrefslogtreecommitdiff
path: root/trainer/plugins.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-14 19:15:58 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-14 19:15:58 +0200
commit60fb2b7c87b7e6aa179c6a973a8d6e39cbe7c594 (patch)
tree8a738a43e8583f38f151cdc643a38b5a9437cda2 /trainer/plugins.py
parent9766ef0f3a539be7ee68bb93918f25a3298afe39 (diff)
parente2d8a6f26c5e44d970d7c069f171105376835495 (diff)
Merge branch 'master' of asdf.us:samplernn
Diffstat (limited to 'trainer/plugins.py')
-rw-r--r--trainer/plugins.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/trainer/plugins.py b/trainer/plugins.py
index f8c299b..0126870 100644
--- a/trainer/plugins.py
+++ b/trainer/plugins.py
@@ -141,7 +141,7 @@ class SaverPlugin(Plugin):
class GeneratorPlugin(Plugin):
- pattern = 'ep{}-s{}.wav'
+ pattern = 'd-{}-ep{}-s{}.wav'
def __init__(self, samples_path, n_samples, sample_length, sample_rate):
super().__init__([(1, 'epoch')])
@@ -159,7 +159,7 @@ class GeneratorPlugin(Plugin):
for i in range(self.n_samples):
write_wav(
os.path.join(
- self.samples_path, self.pattern.format(epoch_index, i + 1)
+ self.samples_path, self.pattern.format(int(time.time()), epoch_index, i + 1)
),
samples[i, :], sr=self.sample_rate, norm=True
)
@@ -168,7 +168,7 @@ class GeneratorPlugin(Plugin):
class StatsPlugin(Plugin):
data_file_name = 'stats.pkl'
- plot_pattern = '{}.svg'
+ plot_pattern = 'd-{}-{}.svg'
def __init__(self, results_path, iteration_fields, epoch_fields, plots):
super().__init__([(1, 'iteration'), (1, 'epoch')])
@@ -252,7 +252,7 @@ class StatsPlugin(Plugin):
pyplot.legend()
pyplot.savefig(
- os.path.join(self.results_path, self.plot_pattern.format(name))
+ os.path.join(self.results_path, self.plot_pattern.format(int(time.time()), name))
)
@staticmethod