Giter Site home page Giter Site logo

underdoc-wang / mpgcn Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 2.0 11 KB

[ICDE'20] Predicting Origin-Destination Flow via Multi-Perspective Graph Convolutional Network (Pytorch Replication)

License: MIT License

Python 100.00%
graph-neural-networks origin-destination-estimation

mpgcn's People

Contributors

underdoc-wang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

wudixiaona wgzhsh

mpgcn's Issues

Problems with data dimensions

Hello, the author. Excuse me. I want to ask about Data_ Container_ OD. Load in py_ What do the dimensions read from data represent? Why do I need to use reshape (- 1,47,47)?

About dataset

Hello, dear author, can you provide me with Dataset?

[about model arch] there's something different from the original paper?

Hi, author.

  1. In the original paper, there's three grpahs: adj, poi, corre. while your replica has only two grpahs.
Your replica:

MPGCN(
  (branch_models): ModuleList(
    (0): ModuleDict(
      (temporal): LSTM(1, 32, batch_first=True)
      (spatial): ModuleList(
        (0): BDGCN(
          (activation): ReLU()
        )
        (1): BDGCN(
          (activation): ReLU()
        )
        (2): BDGCN(
          (activation): ReLU()
        )
      )
      (fc): Sequential(
        (0): Linear(in_features=32, out_features=1, bias=True)
        (1): ReLU()
      )
    )
    (1): ModuleDict(
      (temporal): LSTM(1, 32, batch_first=True)
      (spatial): ModuleList(
        (0): BDGCN(
          (activation): ReLU()
        )
        (1): BDGCN(
          (activation): ReLU()
        )
        (2): BDGCN(
          (activation): ReLU()
        )
      )
      (fc): Sequential(
        (0): Linear(in_features=32, out_features=1, bias=True)
        (1): ReLU()
      )
    )
  )
)
  1. In the model input, what do the O_dyn_G and D_dyn_G means? it seems that you treat the origin and destination individually?
    def construct_dyn_G(self, OD_data: np.array,
                        perceived_period: int = 7):  # construct dynamic graphs based on OD history
        train_len = int(OD_data.shape[0] * self.params['split_ratio'][0] / sum(self.params['split_ratio']))
        num_periods_in_history = train_len // perceived_period  # dump the remainder
        OD_history = OD_data[:num_periods_in_history * perceived_period, :, :, :]

        O_dyn_G, D_dyn_G = [], []
        for t in range(perceived_period):
            OD_t_avg = np.mean(OD_history[t::perceived_period, :, :, :], axis=0).squeeze(axis=-1)
            O, D = OD_t_avg.shape

            O_G_t = np.zeros((O, O))  # initialize O graph at t
            for i in range(O):
                for j in range(O):
                    O_G_t[i, j] = distance.cosine(OD_t_avg[i, :], OD_t_avg[j, :])  # eq (6)
            D_G_t = np.zeros((D, D))  # initialize D graph at t
            for i in range(D):
                for j in range(D):
                    D_G_t[i, j] = distance.cosine(OD_t_avg[:, i], OD_t_avg[j, :])  # eq (7)
            O_dyn_G.append(O_G_t), D_dyn_G.append(D_G_t)

        return np.stack(O_dyn_G, axis=-1), np.stack(D_dyn_G, axis=-1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.