/mse_l1_loss.py (8f5ce4f7e0b168add5ff2a363faa973a5b56ca48) (870 bytes) (mode 100644) (type blob)

import torch
from torch.nn import functional as F
from torch.nn.modules.loss import _Loss


class MSEL1Loss(_Loss):

    __constants__ = ['reduction']

    def __init__(self, size_average=None, reduce=None, reduction='mean'):
        super(MSEL1Loss, self).__init__(size_average, reduce, reduction)

    def forward(self, input, target):
        return F.mse_loss(input, target, reduction=self.reduction) + F.l1_loss(input, target, reduction=self.reduction)


class MSE4L1Loss(_Loss):
    """
    weight is 1 MSE 4 L1
    """

    __constants__ = ['reduction']

    def __init__(self, size_average=None, reduce=None, reduction='mean'):
        super(MSE4L1Loss, self).__init__(size_average, reduce, reduction)

    def forward(self, input, target):
        return F.mse_loss(input, target, reduction=self.reduction) + 4*F.l1_loss(input, target, reduction=self.reduction)

Mode Type Size Ref File
100644 blob 112 54a0bfa5d13ea1dd49622ed3704ad36f6cd68749 .gitignore
100644 blob 1342 f2eb3073ff4a8536cf4e8104ff942b525e3c7f34 .travis.yml
100644 blob 1436 8c160117e7d11fa6269a931aaef10e5338e5aa9c README.md
100644 blob 9426 33e6824cd270d69e4c4f7a8ff5e1e0753c1473f8 args_util.py
040000 tree - 5e9d7f0e1fd3a9e4d5a37f3d6de0c3ecd3125af8 backup_notebook
040000 tree - 55d1d196f5b6ed4bfc1e8a715df1cfff1dd18117 bug
100644 blob 10469 a34e84e75e9281455164810e170213d7917370a8 crowd_counting_error_metrics.py
100644 blob 71744 f314ab200d2f69c33a470624447e0ec0d663c677 data_flow.py
040000 tree - 7b2560d2cb223bf0574eb278bafeda5a8577c7db data_util
040000 tree - b66e8badfd190582171a4d2cc854a5810971f56c dataset_script
040000 tree - 0e274a373a75486d021c18ca275f5b67cbc3158f debug
040000 tree - 74e02cec26c0d98f846ab7ab573419265856500b demo
040000 tree - 5635f5557152a7d3d85640bbd01d95c10f5aab09 demo_app
040000 tree - 9862b9cbc6e7a1d43565f12d85d9b17d1bf1814e env_file
100644 blob 4460 9b254c348a3453f4df2c3ccbf21fb175a16852de eval_context_aware_network.py
100644 blob 428 35cc7bfe48a4ed8dc56635fd3a6763612d8af771 evaluator.py
100644 blob 18278 10aac007cb3474b78a892861470001a3010b0d0b experiment_main.py
100644 blob 8876 049432d6bde50245a4acba4e116d59605b5b6315 experiment_meow_main.py
100644 blob 1916 1d228fa4fa2887927db069f0c93c61a920279d1f explore_model_summary.py
100644 blob 2718 b09b84e8b761137654ba6904669799c4866554b3 hard_code_variable.py
040000 tree - b3aa858a157f5e1e22c00fdb6f9dd071f4c6c163 local_train_script
100644 blob 15300 cb90faba0bd4a45f2606a1e60975ed05bfacdb07 main_pacnn.py
100644 blob 2760 3c2d5ba1c81ef2770ad216c566e268f4ece17262 main_shanghaitech.py
100644 blob 2683 29189260c1a2c03c8e59cd0b4bd61df19d5ce098 main_ucfcc50.py
100644 blob 2794 f37b3bb572c53dd942c51243bd5b0853228c6ddb model_util.py
040000 tree - c7d8511e2d2dd2ceeaf643a21aff1c444bb65b20 models
100644 blob 870 8f5ce4f7e0b168add5ff2a363faa973a5b56ca48 mse_l1_loss.py
100644 blob 1066 811554259182e63240d7aa9406f315377b3be1ac mse_ssim_loss.py
040000 tree - fff511bacd79e9ea5f3eb4f42a135aaf148be23d notebook
040000 tree - 33dcd308a059b5bd1079bb1394127d77b67bfc9e playground
040000 tree - 92f83fe6ac81e0d08642c202cee2c5747ba8206d predict
040000 tree - 78a1d472a82144062baddabd6ae8b8ca0c19c432 predict_script
100644 blob 2425 5b7fdb5a3d07628f53d25d99dee9d9bafd3fbdcb predict_video_server.py
040000 tree - c7c295e9e418154ae7c754dc888a77df8f50aa61 pytorch_ssim
100644 blob 1727 1cd14cbff636cb6145c8bacf013e97eb3f7ed578 sanity_check_dataloader.py
040000 tree - a1e8ea43eba8a949288a00fff12974aec8692003 saved_model_best
100644 blob 3525 27067234ad3deddd743dcab0d7b3ba4812902656 train_attn_can_adcrowdnet.py
100644 blob 3488 e47bfc7e91c46ca3c61be0c5258302de4730b06d train_attn_can_adcrowdnet_freeze_vgg.py
100644 blob 5352 3ee3269d6fcc7408901af46bed52b1d86ee9818c train_attn_can_adcrowdnet_simple.py
100644 blob 5728 90b846b68f15bdc58e3fd60b41aa4b5d82864ec4 train_attn_can_adcrowdnet_simple_lrscheduler.py
100644 blob 9081 664051f8838434c386e34e6dd6e6bca862cb3ccd train_compact_cnn.py
100644 blob 5702 fdec7cd1ee062aa4a2182a91e2fb1bd0db3ab35f train_compact_cnn_lrscheduler.py
100644 blob 5611 2a241c876015db34681d73ce534221de482b0b90 train_compact_cnn_sgd.py
100644 blob 3525 eb52f7a4462687c9b2bf1c3a887014c4afefa26d train_context_aware_network.py
100644 blob 5651 48631e36a1fdc063a6d54d9206d2fd45521d8dc8 train_custom_compact_cnn.py
100644 blob 5594 07d6c9c056db36082545b5b60b1c00d9d9f6396d train_custom_compact_cnn_lrscheduler.py
100644 blob 5281 8a92eb87b54f71ad2a799a7e05020344a22e22d3 train_custom_compact_cnn_sgd.py
040000 tree - 1e7ec428d32ae85921ba69ae18ebe12c783c94ee train_script
100644 blob 6335 27f49f3ec1f27a0b843aac7a1e0d65166c2d4026 visualize_data_loader.py
100644 blob 1772 449bb484143443c125566907a4b862d1c283c3f3 visualize_util.py
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/hahattpro/crowd_counting_framework

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/hahattpro/crowd_counting_framework

Clone this repository using git:
git clone git://git.rocketgit.com/user/hahattpro/crowd_counting_framework

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main