# Path: pyglm/components/component.py
# class Component(object):
#     """
#     """
#     
#     def __init__(self, model):
#         """ Initialize the component with the parameters from the given model.
#         """
#         pass
#     
#     def get_variables(self):
#         """ Get a dictionary of (name : Theano variable) items for all the
#             symbolic variables associated with this component.
#         """
#         return {}
#     
#     def get_state(self):
#         return {}
# 
#     def preprocess_data(self, data):
#         """ Set the shared memory variables that depend on the data
#         """
#         pass
# 
#     def set_data(self, data):
#         """ Set the shared memory variables that depend on the data
#         """
#         pass
#     
#     def set_hyperparameters(self, model):
#         """ Set hyperparameters of the model
#         """
#         pass
# 
#     def sample(self, acc):
#         """
#         return a sample of the variables
#                 """
#         return {}


import numpy as np
import theano
import theano.tensor as T
from pyglm.components.component import Component
"""
Weight models for the Network GLM
"""



def create_graph_component(model, latent):
    type = model['network']['graph']['type'].lower()
    if type == 'complete':
        graph = CompleteGraphModel(model)
    elif type == 'erdos_renyi' or \
                    type == 'erdosrenyi':
        graph = ErdosRenyiGraphModel(model)
    elif type == 'sbm':
        graph = StochasticBlockGraphModel(model, latent)
    elif type == 'distance':
        graph = LatentDistanceGraphModel(model, latent)
    else:
        raise Exception("Unrecognized graph model: %s" % type)
    return graph



# Path: pyglm/components/component.py
# class Component(object):
#     """
#     """
#     
#     def __init__(self, model):
#         """ Initialize the component with the parameters from the given model.
#         """
#         pass
#     
#     def get_variables(self):
#         """ Get a dictionary of (name : Theano variable) items for all the
#             symbolic variables associated with this component.
#         """
#         return {}
#     
#     def get_state(self):
#         return {}
# 
#     def preprocess_data(self, data):
#         """ Set the shared memory variables that depend on the data
#         """
#         pass
# 
#     def set_data(self, data):
#         """ Set the shared memory variables that depend on the data
#         """
#         pass
#     
#     def set_hyperparameters(self, model):
#         """ Set hyperparameters of the model
#         """
#         pass
# 
#     def sample(self, acc):
#         """
#         return a sample of the variables
#                 """
#         return {}


# Path: pyglm/components/graph.py
import numpy as np
import theano
import theano.tensor as T
from pyglm.components.component import Component

"""
Weight models for the Network GLM
"""



def create_graph_component(model, latent):
    type = model['network']['graph']['type'].lower()
    if type == 'complete':
        graph = CompleteGraphModel(model)
    elif type == 'erdos_renyi' or \
                    type == 'erdosrenyi':
        graph = ErdosRenyiGraphModel(model)
    elif type == 'sbm':
        graph = StochasticBlockGraphModel(model, latent)
    elif type == 'distance':
        graph = LatentDistanceGraphModel(model, latent)
    else:
        raise Exception("Unrecognized graph model: %s" % type)
    return graph



class CompleteGraphModel(Component):