import usbio import echo import xml_tag_extractor import datapoint_extractor import xively_writer usb = usbio.USBIO() idx = xml_tag_extractor.XMLTagExtractor("InstantaneousDemand") dpx = datapoint_extractor.DatapointExtractor() cos = xively_writer.XivelyWriter() ech = echo.Echo() # usb.attach(idx).attach(dpx).attach(cos).attach(ech) usb.attach(idx).attach(dpx).attach(cos) usb.start() usb.thread.join()
epochs = 10000 # Checkpoints saved every 1000 epochs learning_rate = 1e-3 debug = ('-d' in sys.argv) arch = { 'type': 'fc', # 'fc' for fully connected or 'conv' for convolutions 'layers': [256, 128, 64, 2], 'activation': tf.nn.softplus } # a TF function. Ignored for multiplicative which always uses softplus # Run it out = echo.Echo( verbose=True, batch_size=batch_size, epochs=epochs, learning_rate=learning_rate, debug=debug, noise=noise, noise_type=noise_type, d_max=d_max, # controlling the noise binary_inputs=binary_inputs, architecture_args=arch) output_dir = out.log_dir save_script(output_dir, os.path.realpath(__file__), os.path.realpath(echo.__file__)) # Save script before fitting out.fit(x_test, val_data=x_test[-batch_size:]) # out = echo.load('/home/gregv/tmp/tensorflow/0140/model_4999.ckpt', (218, 178, 3)) # Specify checkpoint prefix and data shape to load # output_dir = out.log_dir # Visualize results # 1. RECONSTRUCTION z_test = out.transform(x_test[:500])
import file_reader import echo fr = file_reader.FileReader("testfile.xml") fr.attach(echo.Echo()) fr.start() fr.thread.join()
import file_reader import echo import xml_tag_extractor print """Test XMLTagExtractor with a file that starts partway through a fragment""" fr = file_reader.FileReader("testfile2.xml") fr.attach(xml_tag_extractor.XMLTagExtractor("InstantaneousDemand")).attach( echo.Echo()) fr.start() fr.thread.join()
import file_reader import echo import xml_tag_extractor import datapoint_extractor fr = file_reader.FileReader("testfile.xml") idx = xml_tag_extractor.XMLTagExtractor("InstantaneousDemand") dpx = datapoint_extractor.DatapointExtractor() fr.attach(idx).attach(dpx).attach(echo.Echo()) fr.start() fr.thread.join()
import usbio import echo usb = usbio.USBIO() usb.attach(echo.Echo()) usb.start() usb.thread.join()