MacroTools provides a library of tools for working with Julia code and expressions.

Overview

MacroTools.jl

Build Status

MacroTools provides a library of tools for working with Julia code and expressions. This includes a powerful template-matching system and code-walking tools that let you do deep transformations of code in a few lines. See the docs for more info.

Suggestions, issues and pull requsts are welcome.

Installation

]add MacroTools
Comments
  • Fixes 165, Fixes 177.

    Fixes 165, Fixes 177.

    A partial rewrite of splitarg and combinearg to fix https://github.com/FluxML/MacroTools.jl/issues/165 and https://github.com/FluxML/MacroTools.jl/issues/177.

    The big change here is that arg_type can be nothing if no type is declared for an argument. I know that this is a change to the interface, but I also see no other way to fix the problem. While we are changing the interface, we may want to consider handling literal nothing as an argument default through the base Some and something interface. (discussed in https://github.com/FluxML/MacroTools.jl/issues/35).

    opened by willow-ahrens 23
  • Option to deterministically generate unique ids instead of randomized animal names

    Option to deterministically generate unique ids instead of randomized animal names

    There are a couple of problems with the current animal name scheme used in alias_gensyms:

    1. There are only about 220 animal names in animals.txt. If you have more than 220 gensyms the following line in the current alias_gensyms function is going to error out:

    [email protected]!(syms, x, pop!(left))

    (left is a copy of the animals symbol list)

    1. Currently, the animal names list is randomized when the package is initialized. While working on ONNX.jl we were finding that given the same inputs we would get different code generated due to this randomization. This makes it very difficult for us to debug as we made changes to ONNX.jl and wanted to compare code generated from a prior version on the same inputs.

    This patch generates a simple unique id in the form of "sym_id_$counter" where the counter value is incremented on each gensym encountered.

    I would have preferred replacing all of the "#" characters in the gensym with blanks, however that did not work for me even though I tried the same scheme in the REPL on a gensym string and it did work (see the comment I added in alias_gensyms - maybe someone could get that working?)

    opened by philtomson 13
  • Support function return types in longdef/shortdef

    Support function return types in longdef/shortdef

    I also have a function that uses MacroTools to parse any function definition and return (name, arg, kwargs, body, return_type). Would that be accepted?

    opened by cstjean 13
  • more faithfully reconstruct original function in combinedef

    more faithfully reconstruct original function in combinedef

    Previously combinedef would put an ::Any return type annotation on any function it reconstructed that didn't have one originally, and also wrap the function body in one extra begin block. These both seem completely superfluous except amazingly when combined they trigger the bug I reported here: https://github.com/JuliaLang/julia/issues/29326.

    This PR gets rid of those things and more faithfully reconstructs the original function.

    I also switched to returning the expression via @q which would allow whatever macro is calling combinedef to insert the desired line numbers in there.

    opened by marius311 9
  • move shuffling of animals to be done on demand instead of during initialization

    move shuffling of animals to be done on demand instead of during initialization

    This package is heavily used throughout the ecosystem so optimizing its load time is quite important. The compilation time of the shuffle! call in the __init__ function adds quite a bit of overhead, so I moved this to be done the first time the variable is actually used instead.

    Without this PR:

    julia> @time using MacroTools
      0.067275 seconds (142.56 k allocations: 9.640 MiB, 61.33% compilation time)
    

    With this PR:

    julia> @time using MacroTools
      0.024947 seconds (28.79 k allocations: 3.159 MiB, 22.04% compilation time)
    

    It also removed quite a bit of "noise" when profiling other packages load time that happens to depend on this pacakge recursively.

    opened by KristofferC 8
  • code quality improvements from JET analysis

    code quality improvements from JET analysis

    I ran JET analysis on this package, and fixed some true positive errors.

    run JET on MacroTools

    julia> using JET
    julia> report_file("src/MacroTools.jl"; analyze_from_definitions = true, annotate_types = true)
    

    Before this PR

    ═════ 11 possible errors found ═════
    ┌ @ src/match/match.jl:27 Base.getproperty(Base.getproperty(MacroTools.Base, :match::Symbol)::typeof(match)(r"^@?(.*?)_+(_str)?$", MacroTools.string(s::Symbol)::String)::Union{Nothing, RegexMatch}, :captures::Symbol)
    │┌ @ Base.jl:33 Base.getfield(x::Nothing, f::Symbol)
    ││ type Nothing has no field captures
    │└──────────────
    ┌ @ src/match/types.jl:20 MacroTools.map(MacroTools.totype, ts::Vector{Symbol})
    │┌ @ abstractarray.jl:2301 Base.collect_similar(A::Vector{Symbol}, Base.Generator(f::typeof(MacroTools.totype), A::Vector{Symbol})::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)})
    ││┌ @ array.jl:620 Base._collect(cont::Vector{Symbol}, itr::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)}, Base.IteratorEltype(itr::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)})::Base.EltypeUnknown, Base.IteratorSize(itr::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)})::Base.HasShape{1})
    │││┌ @ array.jl:710 Base.collect_to_with_first!(Base._similar_for(c::Vector{Symbol}, Base.typeof(v1::Union{Expr, Symbol})::Union{Type{Expr}, Type{Symbol}}, itr::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)}, isz::Base.HasShape{1})::Union{Vector{Expr}, Vector{Symbol}}, v1::Union{Expr, Symbol}, itr::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)}, st::Int64)
    ││││┌ @ array.jl:715 Base.setindex!(dest::Vector{Symbol}, v1::Expr, i1::Int64)
    │││││┌ @ array.jl:853 Base.convert(_::Type{Symbol}, x::Expr)
    ││││││ no matching method found for call signature: Base.convert(_::Type{Symbol}, x::Expr)
    │││││└────────────────
    ││││┌ @ array.jl:715 Base.setindex!(dest::Vector{Expr}, v1::Symbol, i1::Int64)
    │││││┌ @ array.jl:853 Base.convert(_::Type{Expr}, x::Symbol)
    ││││││ no matching method found for call signature: Base.convert(_::Type{Expr}, x::Symbol)
    │││││└────────────────
    ┌ @ src/utils.jl:21 Base.collect(Base.Generator(#11::MacroTools.var"#11#12", MacroTools.map(MacroTools.esc, xs::Tuple)::Any)::Base.Generator{_A, MacroTools.var"#11#12"} where _A)
    │┌ @ array.jl:697 Base.collect_to_with_first!(Base._array_for(Base.typeof(v1::Expr)::Type{Expr}, Base.getproperty(itr::Base.Generator{_A, MacroTools.var"#11#12"} where _A, :iter::Symbol)::Any, isz::Any)::Any, v1::Expr, itr::Base.Generator{_A, MacroTools.var"#11#12"} where _A, st::Any)
    ││┌ @ array.jl:721 Base.grow_to!(dest::Any, itr::Base.Generator{_A, MacroTools.var"#11#12"} where _A, st::Any)
    │││┌ @ dict.jl:153 Base.indexed_iterate(Core.getfield(Base.indexed_iterate(y::Tuple{Expr, Any}, 1)::Tuple{Expr, Int64}, 1)::Expr, 1)
    ││││┌ @ tuple.jl:89 Base.iterate(I::Expr)
    │││││ no matching method found for call signature: Base.iterate(I::Expr)
    ││││└───────────────
    ┌ @ src/utils.jl:423 MacroTools.rebuilddef(MacroTools.striplines(dict::Dict)::Dict)
    │ variable MacroTools.rebuilddef is not defined: MacroTools.rebuilddef(MacroTools.striplines(dict::Dict)::Dict)
    └────────────────────
    ┌ @ src/utils.jl:455 Core.tuple(splitvar::MacroTools.var"#splitvar#35"(arg::Any)::Union{Nothing, Tuple{Any, Any}}, Core.tuple(is_splat::Bool, default::Any)::Tuple{Bool, Any}...)
    │ no matching method found for call signature: Core.tuple(splitvar::MacroTools.var"#splitvar#35"(arg::Any)::Union{Nothing, Tuple{Any, Any}}, Core.tuple(is_splat::Bool, default::Any)::Tuple{Bool, Any}...)
    └────────────────────
    ┌ @ src/utils.jl:457 Core.tuple(splitvar::MacroTools.var"#splitvar#35"(arg_expr2::Any)::Union{Nothing, Tuple{Any, Any}}, Core.tuple(is_splat::Bool, MacroTools.nothing)::Tuple{Bool, Nothing}...)
    │ no matching method found for call signature: Core.tuple(splitvar::MacroTools.var"#splitvar#35"(arg_expr2::Any)::Union{Nothing, Tuple{Any, Any}}, Core.tuple(is_splat::Bool, MacroTools.nothing)::Tuple{Bool, Nothing}...)
    └────────────────────
    ┌ @ src/structdef.jl:13 MacroTools.parse_error(ex::Any)
    │ variable MacroTools.parse_error is not defined: MacroTools.parse_error(ex::Any)
    └───────────────────────
    ┌ @ src/structdef.jl:21 MacroTools.parse_error(ex::Any)
    │ variable MacroTools.parse_error is not defined: MacroTools.parse_error(ex::Any)
    └───────────────────────
    ┌ @ src/structdef.jl:29 MacroTools.parse_error(ex::Any)
    │ variable MacroTools.parse_error is not defined: MacroTools.parse_error(ex::Any)
    └───────────────────────
    ┌ @ src/examples/destruct.jl:24 MacroTools.error("Can't destructure fields with default values")
    │┌ @ error.jl:33 error(::String)
    ││ may throw: Base.throw($(Expr(:invoke, MethodInstance for ErrorException(::String), :(Base.ErrorException), Core.Argument(2)))::ErrorException)
    │└───────────────
    

    After this PR: only the false positives ramain (Julia's inference or JET itself should be improved)

    ═════ 4 possible errors found ═════
    ┌ @ src/match/types.jl:20 MacroTools.map(MacroTools.totype, ts::Vector{Symbol})
    │┌ @ abstractarray.jl:2301 Base.collect_similar(A::Vector{Symbol}, Base.Generator(f::typeof(MacroTools.totype), A::Vector{Symbol})::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)})
    ││┌ @ array.jl:620 Base._collect(cont::Vector{Symbol}, itr::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)}, Base.IteratorEltype(itr::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)})::Base.EltypeUnknown, Base.IteratorSize(itr::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)})::Base.HasShape{1})
    │││┌ @ array.jl:710 Base.collect_to_with_first!(Base._similar_for(c::Vector{Symbol}, Base.typeof(v1::Union{Expr, Symbol})::Union{Type{Expr}, Type{Symbol}}, itr::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)}, isz::Base.HasShape{1})::Union{Vector{Expr}, Vector{Symbol}}, v1::Union{Expr, Symbol}, itr::Base.Generator{Vector{Symbol}, typeof(MacroTools.totype)}, st::Int64)
    ││││┌ @ array.jl:715 Base.setindex!(dest::Vector{Symbol}, v1::Expr, i1::Int64)
    │││││┌ @ array.jl:853 Base.convert(_::Type{Symbol}, x::Expr)
    ││││││ no matching method found for call signature: Base.convert(_::Type{Symbol}, x::Expr)
    │││││└────────────────
    ││││┌ @ array.jl:715 Base.setindex!(dest::Vector{Expr}, v1::Symbol, i1::Int64)
    │││││┌ @ array.jl:853 Base.convert(_::Type{Expr}, x::Symbol)
    ││││││ no matching method found for call signature: Base.convert(_::Type{Expr}, x::Symbol)
    │││││└────────────────
    ┌ @ src/utils.jl:21 Base.collect(Base.Generator(#11::MacroTools.var"#11#12", MacroTools.map(MacroTools.esc, xs::Tuple)::Any)::Base.Generator{_A, MacroTools.var"#11#12"} where _A)
    │┌ @ array.jl:697 Base.collect_to_with_first!(Base._array_for(Base.typeof(v1::Expr)::Type{Expr}, Base.getproperty(itr::Base.Generator{_A, MacroTools.var"#11#12"} where _A, :iter::Symbol)::Any, isz::Any)::Any, v1::Expr, itr::Base.Generator{_A, MacroTools.var"#11#12"} where _A, st::Any)
    ││┌ @ array.jl:721 Base.grow_to!(dest::Any, itr::Base.Generator{_A, MacroTools.var"#11#12"} where _A, st::Any)
    │││┌ @ dict.jl:153 Base.indexed_iterate(Core.getfield(Base.indexed_iterate(y::Tuple{Expr, Any}, 1)::Tuple{Expr, Int64}, 1)::Expr, 1)
    ││││┌ @ tuple.jl:89 Base.iterate(I::Expr)
    │││││ no matching method found for call signature: Base.iterate(I::Expr)
    ││││└───────────────
    ┌ @ src/examples/destruct.jl:24 MacroTools.error("Can't destructure fields with default values")
    │┌ @ error.jl:33 error(::String)
    ││ may throw: Base.throw($(Expr(:invoke, MethodInstance for ErrorException(::String), :(Base.ErrorException), Core.Argument(2)))::ErrorException)
    │└───────────────
    
    opened by aviatesk 8
  • improve code quality and type instabilities

    improve code quality and type instabilities

    I used JET and fixed some actual errors and type instabilities. (this PR is the final output of my demo at our workshop)

    /cc @pfitzseb Could you review this PR, please ? :)

    opened by aviatesk 7
  • splitarg incompatible with kwargs on 1.7

    splitarg incompatible with kwargs on 1.7

    Therefore, it is no longer safe to do funcdef[:kwargs] = map(arg->combinearg(splitarg(arg)...), funcdef[:kwargs], since this would transform a definition like f(;kwargs...) to f(;kwargs::Any...) which is no longer allowed in Julia 1.7. I don't know why that's no longer allowed, but from the REPL:

    ERROR: syntax: "x::Any" is not a valid function argument name around REPL[3]:1
    Stacktrace:
     [1] top-level scope
       @ REPL[3]:1
    
    opened by willow-ahrens 6
  • make

    make "slurp" pattern configurable

    This PR setups IGNORED_SLURP_PATTERNS::Set{Symbol}, which allows users to configure patterns that should not be recognized as "slurp"s.

    The motivation here is that there can be double-scores in variable names and so we sometimes may want them not to be recognized as "slurp" pattern.

    For example, let's consider when we want to specify a pattern that only matches __init__() expression:

    julia> @capture(:(__init__()), __init__()), @capture(:(foo()), __init__()) # you may want the latter case not to match
    (true, true)
    

    With this PR, we can configure IGNORED_SLURP_PATTERNS and achieve what we want:

    julia> push!(MacroTools.IGNORED_SLURP_PATTERNS, :__init__); # configure `IGNORED_SLURP_PATTERNS`
    
    julia> @capture(:(__init__()), __init__()), @capture(:(foo()), __init__()) # now `__init__` isn't recognized as slurp pattern
    (true, false)
    

    IGNORED_SLURP_PATTERNS is initialized as an empty set, and thus this change doesn't break any existing behavior by default.

    opened by aviatesk 6
  • don't use exceptions to implement `ismatch` and `trymatch`

    don't use exceptions to implement `ismatch` and `trymatch`

    This is causing https://github.com/JuliaLang/julia/issues/28221. At least for APIs that return a result instead of exposing MatchError, the package should use return values instead of exceptions.

    opened by JeffBezanson 5
  • bizzare match failure for macros in type assertions

    bizzare match failure for macros in type assertions

    MacroTools can't match macros when they appear in the type assertions in function calls. This seems like a crazy issue, but a key macro in my package depended on this functionality and now something has changed with the latest julia build and things fail. Any ideas as to why this match failure would happen?

                   _
       _       _ _(_)_     |  A fresh approach to technical computing
      (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
       _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
      | | | | | | |/ _` |  |
      | | |_| | | | (_| |  |  Version 0.7.0-DEV.5246 (2018-05-29 13:27 UTC)
     _/ |\__'_|_|_|\__'_|  |  Commit 082be9a (8 days old master)
    |__/                   |  x86_64-apple-darwin17.5.0
    
    (v0.7) pkg> up MacroTools
      Updating registry at `~/.julia/registries/Uncurated`
      Updating git-repo `https://github.com/JuliaRegistries/Uncurated.git`
     Resolving package versions...
      Updating `~/.julia/environments/v0.7/Project.toml`
     [no changes]
      Updating `~/.julia/environments/v0.7/Manifest.toml`
     [no changes]
    
    julia> using MacroTools
    
    julia> x = :(foo(x::@bar(qux))).args[2].args[2]
    :(#= REPL[3]:1 =# @bar qux)
    
    julia> :(@bar(qux))
    :(#= REPL[4]:1 =# @bar qux)
    
    julia> x.head
    :macrocall
    
    julia> :(@bar(qux)).head
    :macrocall
    
    julia> x.args
    3-element Array{Any,1}:
     Symbol("@bar")
     :(#= REPL[3]:1 =#)
     :qux
    
    julia> :(@bar(qux)).args
    3-element Array{Any,1}:
     Symbol("@bar")
     :(#= REPL[8]:1 =#)
     :qux
    
    julia> @capture(x, @bar(qux))
    false
    
    julia> @capture(:(@bar(qux)), @bar(qux))
    true
    

    EDIT: It appears that this has something to do with line number nodes getting passed as arguments to macros. I rolled a custom solution for myself, but I'll dig into this sometime when I have more time. I don't think this has anything to do with the type assertions at all now.

    opened by willow-ahrens 5
  • Splitdef errors on anonymous function with a single varargs argument

    Splitdef errors on anonymous function with a single varargs argument

    splitdef fails with an assertion on an anonymous function with a single varargs argument:

    julia> splitdef(Meta.parse(" (args...) -> 0 "))
    ERROR: ArgumentError: Not a function definition: :(args...->begin
              #= none:1 =#
              0
          end)
    Stacktrace:
     [1] splitdef(fdef::Expr)
       @ MacroTools ~/.julia/packages/MacroTools/PP9IQ/src/utils.jl:317
    

    Either adding another argument or using the long form of the definition is fine:

    julia> splitdef(Meta.parse(" (x, args...) -> 0 "))
    Dict{Symbol, Any} with 4 entries:
      :args        => Any[:x, :(args...)]
      :body        => quote…
      :kwargs      => Any[]
      :whereparams => ()
    
    julia> splitdef(Meta.parse(" function f(args...) 0 end "))
    Dict{Symbol, Any} with 5 entries:
      :name        => :f
      :args        => Any[:(args...)]
      :kwargs      => Any[]
      :body        => quote…
      :whereparams => ()
    
    opened by julbinb 1
  • @capture union problem

    @capture union problem

    Similar to what was noted in https://github.com/FluxML/MacroTools.jl/issues/40#issuecomment-357466077,

    julia> @capture :(myvariable = 2) (lhs_Symbol = rhs_)
    true
    
    julia> @capture :(myvariable = 2) (lhs_Symbol = rhs_) | someotherpat
    false
    
    julia> @capture :(myvariable = 2) (lhs_ = rhs_) | someotherpat
    true
    

    The second match should be true as well.

    opened by cstjean 0
  • add dict interface splitargdef and combineargdef

    add dict interface splitargdef and combineargdef

    This PR adds new methods splitargdef and combineargdef (in addition to existing splitarg and combinearg) that use dictionaries as an interface. The dict interface more completely expresses corner cases, as described in https://github.com/FluxML/MacroTools.jl/pull/178. In particular, it provides robust solutions for literal nothing argument defaults and avoids typeasserts when no type is given for an argument.

    opened by willow-ahrens 5
  • `isdef()` seems to return true in any case

    `isdef()` seems to return true in any case

    help?> MacroTools.isdef
      Test for function definition expressions.
    
    julia> MacroTools.isdef(:(f() = 3))
    true
    
    julia> MacroTools.isdef(:(f()))
    true
    
    julia> MacroTools.isdef(:ix)
    true
    
    
    opened by omlins 2
  • rmlines would be more useful if it worked recursively

    rmlines would be more useful if it worked recursively

    rmlines would be more useful it it worked recursively.

    rmlines(Meta.parse("""
    begin
       begin
          begin
    end
    end
    end"""))
    quote
        begin
            #= none:3 =#
            begin
                #= none:4 =#
            end
        end
    end
    

    Yes, one could use postwalk, but I don't think one should have to.

    Also, why isn't postwalk exported?

    At the very least, the documentation should manage expectations by saying that it doesn'[t work recursively and suggesting the use of postwalk.

    opened by MarkNahabedian 1
Releases(v0.5.10)
Owner
FluxML
The Elegant Machine Learning Stack
FluxML
ScaleNet: A Shallow Architecture for Scale Estimation

ScaleNet: A Shallow Architecture for Scale Estimation Repository for the code of ScaleNet paper: "ScaleNet: A Shallow Architecture for Scale Estimatio

Axel Barroso 34 Nov 09, 2022
Towards Boosting the Accuracy of Non-Latin Scene Text Recognition

Convolutional Recurrent Neural Network + CTCLoss | STAR-Net Code for paper "Towards Boosting the Accuracy of Non-Latin Scene Text Recognition" Depende

Sanjana Gunna 7 Aug 07, 2022
Deep learning models for classification of 15 common weeds in the southern U.S. cotton production systems.

CottonWeeds Deep learning models for classification of 15 common weeds in the southern U.S. cotton production systems. requirements pytorch torchsumma

Dong Chen 8 Jun 07, 2022
Learning to Adapt Structured Output Space for Semantic Segmentation, CVPR 2018 (spotlight)

Learning to Adapt Structured Output Space for Semantic Segmentation Pytorch implementation of our method for adapting semantic segmentation from the s

Yi-Hsuan Tsai 782 Dec 30, 2022
Deep Hedging Demo - An Example of Using Machine Learning for Derivative Pricing.

Deep Hedging Demo Pricing Derivatives using Machine Learning 1) Jupyter version: Run ./colab/deep_hedging_colab.ipynb on Colab. 2) Gui version: Run py

Yu Man Tam 102 Jan 06, 2023
Deep Learning Algorithms for Hedging with Frictions

Deep Learning Algorithms for Hedging with Frictions This repository contains the Forward-Backward Stochastic Differential Equation (FBSDE) solver and

Xiaofei Shi 3 Dec 22, 2022
Implementation of the Triangle Multiplicative module, used in Alphafold2 as an efficient way to mix rows or columns of a 2d feature map, as a standalone package for Pytorch

Triangle Multiplicative Module - Pytorch Implementation of the Triangle Multiplicative module, used in Alphafold2 as an efficient way to mix rows or c

Phil Wang 22 Oct 28, 2022
Code for Contrastive-Geometry Networks for Generalized 3D Pose Transfer

Code for Contrastive-Geometry Networks for Generalized 3D Pose Transfer

18 Jun 28, 2022
Official implementation for (Refine Myself by Teaching Myself : Feature Refinement via Self-Knowledge Distillation, CVPR-2021)

FRSKD Official implementation for Refine Myself by Teaching Myself : Feature Refinement via Self-Knowledge Distillation (CVPR-2021) Requirements Pytho

75 Dec 28, 2022
Pytorch implementation AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks

AttnGAN Pytorch implementation for reproducing AttnGAN results in the paper AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative

Tao Xu 1.2k Dec 26, 2022
Code for Understanding Pooling in Graph Neural Networks

Select, Reduce, Connect This repository contains the code used for the experiments of: "Understanding Pooling in Graph Neural Networks" Setup Install

Daniele Grattarola 37 Dec 13, 2022
The official code of "SCROLLS: Standardized CompaRison Over Long Language Sequences".

SCROLLS This repository contains the official code of the paper: "SCROLLS: Standardized CompaRison Over Long Language Sequences". Links Official Websi

TAU NLP Group 39 Dec 23, 2022
ReConsider is a re-ranking model that re-ranks the top-K (passage, answer-span) predictions of an Open-Domain QA Model like DPR (Karpukhin et al., 2020).

ReConsider ReConsider is a re-ranking model that re-ranks the top-K (passage, answer-span) predictions of an Open-Domain QA Model like DPR (Karpukhin

Facebook Research 47 Jul 26, 2022
Public scripts, services, and configuration for running a smart home K3S network cluster

makerhouse_network Public scripts, services, and configuration for running MakerHouse's home network. This network supports: TODO features here For mo

Scott Martin 1 Jan 15, 2022
Reference code for the paper "Cross-Camera Convolutional Color Constancy" (ICCV 2021)

Cross-Camera Convolutional Color Constancy, ICCV 2021 (Oral) Mahmoud Afifi1,2, Jonathan T. Barron2, Chloe LeGendre2, Yun-Ta Tsai2, and Francois Bleibe

Mahmoud Afifi 76 Jan 07, 2023
BC3407-Group-5-Project - BC3407 Group Project With Python

BC3407-Group-5-Project As the world struggles to contain the ever-changing varia

1 Jan 26, 2022
Revisting Open World Object Detection

Revisting Open World Object Detection Installation See INSTALL.md. Dataset Our new data division is based on COCO2017. We divide the training set into

58 Dec 23, 2022
ICCV2021, Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet

Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet, ICCV 2021 Update: 2021/03/11: update our new results. Now our T2T-ViT-14 w

YITUTech 1k Dec 31, 2022
Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Matthias Wright 169 Dec 26, 2022
Source codes for the paper "Local Additivity Based Data Augmentation for Semi-supervised NER"

LADA This repo contains codes for the following paper: Jiaao Chen*, Zhenghui Wang*, Ran Tian, Zichao Yang, Diyi Yang: Local Additivity Based Data Augm

GT-SALT 36 Dec 02, 2022