2019-10-31 13:52:25 +08:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
CS224N 2018-19: Homework 5
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
### YOUR CODE HERE for part 1i
|
2019-12-03 17:36:23 +08:00
|
|
|
import torch.nn as nn
|
|
|
|
|
import torch.nn.functional as F
|
|
|
|
|
import numpy as np
|
|
|
|
|
class CNN(nn.Module):
|
|
|
|
|
def __init__(self, in_ch, out_ch,k=5):
|
|
|
|
|
"""
|
|
|
|
|
Apply the output of the convolution later (x_conv) through a highway network
|
|
|
|
|
@param D_in (int): Size of input layer
|
|
|
|
|
@param H (int): Size of Hidden layer
|
|
|
|
|
@param D_out (int): Size of output layer
|
|
|
|
|
@param prob (float): Probability of dropout
|
|
|
|
|
"""
|
|
|
|
|
super(CNN, self).__init__()
|
|
|
|
|
|
2019-10-31 13:52:25 +08:00
|
|
|
|
2019-12-03 17:36:23 +08:00
|
|
|
|
|
|
|
|
def forward(self, x):
|
|
|
|
|
pass
|
2019-10-31 13:52:25 +08:00
|
|
|
### END YOUR CODE
|
|
|
|
|
|