In [1]:
# Example parameters
model_file = "/users/avsec/workspace/basepair/data/processed/chipnexus/exp/wta-ae/54/model.h5"
_id = 54
name = "wta-ae"
gpu = ""
use_seq = True
In [2]:
import os
os.environ['CUDA_VISIBLE_DEVICES'] = str("")
import numpy as np
from keras.models import load_model
from basepair.config import create_tf_session
from basepair import models, datasets
from basepair.losses import twochannel_multinomial_nll
from basepair.layers import SpatialLifetimeSparsity
from basepair.plots import *
from keras.models import load_model
/users/avsec/bin/anaconda3/envs/chipnexus/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Using TensorFlow backend.
In [3]:
model = load_model(
        model_file,
        custom_objects={"twochannel_multinomial_nll": twochannel_multinomial_nll,
                        "SpatialLifetimeSparsity": SpatialLifetimeSparsity})
WARNING:tensorflow:From /users/avsec/bin/anaconda3/envs/chipnexus/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py:497: calling conv1d (from tensorflow.python.ops.nn_ops) with data_format=NHWC is deprecated and will be removed in a future version.
Instructions for updating:
`NHWC` for data_format is deprecated, use `NWC` instead
2018-05-15 23:29:58,432 [WARNING] From /users/avsec/bin/anaconda3/envs/chipnexus/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py:497: calling conv1d (from tensorflow.python.ops.nn_ops) with data_format=NHWC is deprecated and will be removed in a future version.
Instructions for updating:
`NHWC` for data_format is deprecated, use `NWC` instead
WARNING:tensorflow:From /users/avsec/bin/anaconda3/envs/chipnexus/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.
2018-05-15 23:30:05,217 [WARNING] From /users/avsec/bin/anaconda3/envs/chipnexus/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.
In [4]:
train, valid, test = datasets.seq_inp_exo_out()
In [5]:
p = Seq2NexusTrack({"seq": train[0], "chip_nexus": train[1]}, #train[1], #
                   train[1], model)
In [6]:
p.plot()
In [7]:
p = Seq2NexusTrack({"seq": test[0], "chip_nexus": test[1]}, 
                   test[1], model)
In [8]:
p.plot(sort='top')
In [9]:
p = CAENexus({"seq": test[0], "chip_nexus": test[1]},
             test[1], test[2], model)
In [10]:
p.plot(10, sort='top', bottleneck_type='after', show_seq=use_seq)
In [11]:
deconv_filters(model, figsize=(15, 4), ncol=5)