python_code
stringlengths
0
679k
repo_name
stringlengths
9
41
file_path
stringlengths
6
149
import torch import numpy as np from torch.utils.data.sampler import Sampler class DistributedSampler(Sampler): def __init__(self, dataset, batch_size, world_size, rank): """ Constructor for the DistributedSampler. :param dataset: dataset :param batch_size: local batch size ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/sampler.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/helpers.py
# Copyright (c) 2017 Keith Ito """ from https://github.com/keithito/tacotron """ import re import string from . import cleaners def _clean_text(text, cleaner_names, *args): for name in cleaner_names: cleaner = getattr(cleaners, name) if not cleaner: raise Exception('Unknown cleaner: %s'...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/text/__init__.py
# Copyright (c) 2017 Keith Ito # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/text/numbers.py
# Copyright (c) 2017 Keith Ito """ from https://github.com/keithito/tacotron """ ''' Defines the set of symbols used in text input to the model. The default is a set of ASCII characters that works well for English or text that has been run through Unidecode. For other data, you can modify _characters. See TRAINING_DA...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/text/symbols.py
# Copyright (c) 2017 Keith Ito # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/text/cleaners.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/text/unidecoder/replacements.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/text/unidecoder/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/text/unidecoder/homoglyphs.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/dali/data_loader.py
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/dali/__init__.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/dali/iterator.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/common/dali/pipeline.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/quartznet/config.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/QuartzNet/quartznet/model.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/train.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/inference.py
# ***************************************************************************** # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/triton/jasper_module.py
# ***************************************************************************** # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/triton/converter.py
#!/usr/bin/python # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/triton/speech_utils.py
#!/usr/bin/python # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/triton/jasper-client.py
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/triton/pytorch/__init__.py
# ***************************************************************************** # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/triton/pytorch/utils.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/utils/convert_librispeech.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/utils/download_librispeech.py
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/utils/__init__.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/utils/preprocessing_utils.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/utils/download_utils.py
import atexit import glob import os import re from pathlib import Path import numpy as np import torch from torch.utils.tensorboard import SummaryWriter import dllogger from dllogger import StdOutBackend, JSONStreamBackend, Verbosity tb_loggers = {} class TBLogger: """ xyz_dummies: stretch the screen with...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/tb_dllogger.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/metrics.py
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/filter_warnings.py
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/__init__.py
import math import random import librosa import torch import torch.nn as nn class BaseFeatures(nn.Module): """Base class for GPU accelerated audio preprocessing.""" __constants__ = ["pad_align", "pad_to_max_duration", "max_len"] def __init__(self, pad_align, pad_to_max_duration, max_duration, ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/features.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/optimizers.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/dataset.py
import numpy as np class BenchmarkStats: """ Tracks statistics used for benchmarking. """ def __init__(self): self.utts = [] self.times = [] self.losses = [] def update(self, utts, times, losses): self.utts.append(utts) self.times.append(times) self.losses....
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/utils.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/audio.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/helpers.py
# Copyright (c) 2017 Keith Ito """ from https://github.com/keithito/tacotron """ import re import string from . import cleaners def _clean_text(text, cleaner_names, *args): for name in cleaner_names: cleaner = getattr(cleaners, name) if not cleaner: raise Exception('Unknown cleaner: %s'...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/text/__init__.py
# Copyright (c) 2017 Keith Ito # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/text/numbers.py
# Copyright (c) 2017 Keith Ito """ from https://github.com/keithito/tacotron """ ''' Defines the set of symbols used in text input to the model. The default is a set of ASCII characters that works well for English or text that has been run through Unidecode. For other data, you can modify _characters. See TRAINING_DA...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/text/symbols.py
# Copyright (c) 2017 Keith Ito # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/text/cleaners.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/text/unidecoder/replacements.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/text/unidecoder/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/text/unidecoder/homoglyphs.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/dali/data_loader.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/dali/__init__.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/dali/iterator.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/common/dali/pipeline.py
import copy import inspect import typing from ast import literal_eval from contextlib import suppress from numbers import Number import yaml from .model import JasperDecoderForCTC, JasperBlock, JasperEncoder from common.audio import GainPerturbation, ShiftPerturbation, SpeedPerturbation from common.dataset import Aud...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/jasper/config.py
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
DeepLearningExamples-master
PyTorch/SpeechRecognition/Jasper/jasper/model.py
#!/usr/bin/env python # Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restricti...
DeepLearningExamples-master
PyTorch/Translation/GNMT/translate.py
#!/usr/bin/env python # Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restricti...
DeepLearningExamples-master
PyTorch/Translation/GNMT/train.py
import collections import math import os import pathlib import re import pynvml pynvml.nvmlInit() def systemGetDriverVersion(): return pynvml.nvmlSystemGetDriverVersion() def deviceGetCount(): return pynvml.nvmlDeviceGetCount() class device: # assume nvml returns list of 64 bit ints _nvml_affini...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/gpu_affinity.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/utils.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/models/decoder.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/models/gnmt.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/models/attention.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/models/encoder.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/models/seq2seq_base.py
# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, co...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/train/lr_scheduler.py
# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, co...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/train/smoothing.py
# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, co...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/train/table.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/train/trainer.py
# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, co...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/train/fp_optimizers.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/inference/beam_search.py
# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, co...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/inference/tables.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/inference/translator.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/data/config.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/data/dataset.py
# Copyright (c) 2017 Elad Hoffer # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without l...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/data/tokenizer.py
# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, co...
DeepLearningExamples-master
PyTorch/Translation/GNMT/seq2seq/data/sampler.py
# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, co...
DeepLearningExamples-master
PyTorch/Translation/GNMT/scripts/filter_dataset.py
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # import ar...
DeepLearningExamples-master
PyTorch/Translation/Transformer/preprocess.py
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # #---------...
DeepLearningExamples-master
PyTorch/Translation/Transformer/setup.py
#!/usr/bin/env python3 -u # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # #------...
DeepLearningExamples-master
PyTorch/Translation/Transformer/train.py
#!/usr/bin/env python3 -u # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # #------...
DeepLearningExamples-master
PyTorch/Translation/Transformer/inference.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # #--------------------------------...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/options.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import time import torch class A...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/meters.py
import torch.nn.functional as F from torch.nn.modules.loss import _Loss class CrossEntropyCriterion(_Loss): def __init__(self, args): super().__init__() self.padding_idx = args.padding_idx def forward(self, norm_probs, target, reduce=True): """Compute the loss for the given sample. ...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/criterions.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from .multiprocessing_pdb import p...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/__init__.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # #--------------------------------...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/sequence_generator.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # #--------------------------------...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/ddp_trainer.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # #--------------------------------...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/tokenizer.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import multiprocessing import os i...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/multiprocessing_pdb.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # #--------------------------------...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/utils.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # #--------------------------------...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/distributed_utils.py
import os import atexit import time import itertools from collections import OrderedDict import dllogger from dllogger import Backend, JSONStreamBackend from tensorboardX import SummaryWriter import torch class AverageMeter(): def __init__(self): self.reset() def reset(self): self.updated =...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/log_helper.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from torch.optim.optimizer import ...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/optim/nag.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch.optim from . import ...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/optim/sgd.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # #--------------------------------...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/optim/fairseq_optimizer.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import importlib import os from ....
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/optim/__init__.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch.optim from . import ...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/optim/adagrad.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # #--------------------------------...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/optim/adam.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from . import FairseqLRScheduler, ...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/optim/lr_scheduler/fixed_schedule.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch.optim.lr_scheduler f...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/optim/lr_scheduler/reduce_lr_on_plateau.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import importlib import os from ....
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/optim/lr_scheduler/__init__.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from . import FairseqLRScheduler, ...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/optim/lr_scheduler/inverse_square_root_schedule.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from .. import FairseqOptimizer ...
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/optim/lr_scheduler/fairseq_lr_scheduler.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import importlib import os from ....
DeepLearningExamples-master
PyTorch/Translation/Transformer/fairseq/models/__init__.py