Commit 7214aa65 authored by Marius Kriegerowski's avatar Marius Kriegerowski

upd

parent 75298a66
......@@ -8,7 +8,7 @@ from pyrocko.gui import marker
from pyrocko.gf.seismosizer import Engine, Target, LocalEngine
from pyrocko import orthodrome
from pyrocko import pile
from swarm import synthi
from swarm import synthi, source_region
import logging
import random
......@@ -265,9 +265,8 @@ class PileData(DataGenerator):
class GFData(DataGenerator):
swarm = swarm.Swarm.T()
gf_engine = Engine.T()
class GFSwarmData(DataGenerator):
swarm = source_region.Swarm.T()
n_sources = Int.T(default=100)
onset_phase = String.T(default='p')
quantity = String.T(default='velocity')
......@@ -277,7 +276,7 @@ class GFData(DataGenerator):
stations = load_stations(self.fn_stations)
self.targets = synthi.guess_targets_from_stations(
stations, quantity=self.quantity)
self.store = self.gf_engine.get_store() # uses default store
self.store = self.swarm.engine.get_store() # uses default store
self.n_samples_max = int(self.sample_length/self.store.config.deltat)
self.tensor_shape = (len(self.targets), self.n_samples_max)
......@@ -306,7 +305,7 @@ class GFData(DataGenerator):
sources = swarm.get_effective_sources()
self.tensor_shape = (len(self.targets), self.n_samples_max)
response = self.gf_engine.process(
response = self.swarm.engine.process(
sources=sources,
targets=self.targets)
......
......@@ -146,8 +146,7 @@ class Model(Object):
# tf.summary.scalar('lossalternative', lossalternative)
if mode == tf.estimator.ModeKeys.TRAIN:
optimizer = tf.train.AdamOptimizer(
# learning_rate=params.get('learning_rate', 1e-4))
learning_rate=params.get('learning_rate', 1e-4)[0])
learning_rate=params.get('learning_rate', 1e-4))
train_op = optimizer.minimize(
loss=loss, global_step=tf.train.get_global_step())
tf.summary.scalar('loss', loss)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment