Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy.optimize | |
from sklearn.linear_model import Ridge | |
from sklearn.isotonic import IsotonicRegression | |
from sklearn.base import BaseEstimator, RegressorMixin | |
class MonotonicRegression(BaseEstimator, RegressorMixin): | |
""" Smooth increasing piecewise linear regression. | |
During training, it minimizes MSE and the sum of absolute changes in its slope. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import copy | |
from torch import nn | |
from transformers import T5PreTrainedModel | |
from transformers.models.t5.modeling_t5 import T5Stack | |
from transformers.modeling_outputs import SequenceClassifierOutput | |
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss | |
def mean_pooling(inputs, mask): |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder