Crafting a Singleton Class in C++: A Tale of Singular Elegance

Ahoy, fellow coders! Today, let’s embark on a thrilling journey into the realm of singleton classes in C++. If you’re not familiar with the term, fear not! A singleton class is like that one legendary sword in a game—you can only wield one of its kind at a time. In other words, it ensures there’s only ever one instance of a class floating around in your code.

The Singleton Quest Begins…

Picture this: you’re building a mighty castle of code, and you stumble upon a need for a class that must exist in a single, glorious instance. That’s where the singleton pattern comes into play!

Step 1: Raise the Drawbridge with a Private Constructor

In the land of singletons, the first rule is simple yet crucial: make the constructor private! This prevents any mischievous outsider from creating instances of your class willy-nilly.

1
2
3
4
5
class Singleton {
private:
Singleton() {} // Private constructor to prevent instantiation
// Additional implementation goes here...
};

Method 1: Meyers’ Singleton - The Heroic Approach

Now, let’s dive into the magical realm of static member functions. Behold, the power of static! With this enchanting keyword, we can summon a single instance of our class.

1
2
3
4
5
6
7
8
9
class Singleton {
private:
Singleton() {} // Private constructor to prevent instantiation
public:
static Singleton& getInstance() {
static Singleton instance;
return instance;
}
};

Here’s how it works: whenever you call getInstance(), it conjures up a static instance if one doesn’t already exist. Otherwise, it simply returns the existing instance, ensuring there’s only one to rule them all! Meyers’ Singleton leverages the mystical properties of static local variables, ensuring that the instance is forged with utmost care and thread safety.

Method 2: The Static Pointer to Glory

But wait, our adventure isn’t over yet! There’s one more method to explore: the static pointer approach. Brace yourselves as we delve deeper into the arcane arts of C++!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Singleton {
private:
Singleton() {} // Private constructor to prevent instantiation
static Singleton* instancePtr; // Static pointer to the instance

public:
static Singleton* getInstance() {
if (!instancePtr) {
instancePtr = new Singleton();
}
return instancePtr;
}
};

Singleton* Singleton::instancePtr = nullptr; // Initializing the static pointer

This method employs a static pointer to the singleton instance, ensuring lazy initialization and a journey free of unnecessary overhead.

Final Step : Complete Code

Copy the below code in a .cpp file and compile the code below using

g++ -s ./c++/cpp_codes/singleton.cpp -o singleton.out

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<iostream>
#include<bits/stdc++.h>

using namespace std;

class Singleton {
private:
Singleton() {} // Private constructor to prevent instantiation
public:
static Singleton& getInstance() {
static Singleton instance;
return instance;
}
void print(){
cout << "hello world" << endl;
}
};



int main(){
Singleton obj = Singleton::getInstance();
obj.print();
return 0;
}

Special Keyword and

In C++, the static keyword has special significance when applied to member variables and functions:

  • Static Member Variables: When a member variable is declared as static, it means there is only one instance of that variable shared among all instances of the class.
  • Static Member Functions: A static member function is a function that belongs to the class rather than instances of the class. It can be called without an object of the class.

Steps to Implement a Singleton Class:

  • Private Constructor: Ensure that the class has a private constructor to prevent external instantiation.
  • Static Member Function/Object: Provide a static member function or object that returns a reference to the singleton instance.
  • Lazy Initialization: The singleton instance should be created on-demand to conserve resources.
  • Thread Safety (Optional): If the singleton will be accessed by multiple threads, ensure thread safety during initialization. Meyers’ Singleton automatically handles thread safety.

Epilogue: The Singleton Legacy Lives On

And there you have it, intrepid adventurers! By mastering the arcane arts of singleton classes, you’ve unlocked the secrets of controlling class instantiation like a true coding wizard. Whether you choose the static sorcery, the mystical member object, Meyers’ elegance, or the static pointer to glory, remember to wield your singleton powers responsibly in your coding quests!

Morris Traversal in C++

Morris Traversal is a method for traversing binary trees without using any extra space for storing information about nodes. It allows for the traversal of a binary tree in Inorder, Preorder, and Postorder without recursion or using a stack.

Introduction

Morris Traversal is an elegant and efficient algorithm for traversing binary trees. It was introduced by J. H. Morris in 1979. The key idea behind Morris Traversal is to modify the tree as we traverse it so that we can navigate through the nodes without using any additional space for a stack or recursion. This method helps to reduce the space complexity of tree traversal algorithms.

Pseudo Code

The general idea behind Morris Traversal is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
1. Initialize current as root
2. While current is not NULL
a. If current does not have a left child
i. Print current's data
ii. Move to the right child (current = current->right)
b. Else
i. Find the inorder predecessor of current (say it's the rightmost node in current's left subtree, and cannot be current node)
ii. If the right child of the predecessor is NULL
1. Set the right child of the predecessor to current (Creating temp links)
2. Move current to its left child (current = current->left)
iii. Else
1. Set the right child of the predecessor back to NULL (Removing temp links)
2. Print current's data
3. Move current to its right child (current = current->right)

Inorder Traversal using Morris Traversal

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
void morrisInorderTraversal(Node* root) {
Node* current = root;
while (current != nullptr) {
if (current->left == nullptr) {
std::cout << current->data << " ";
current = current->right;
} else {
Node* predecessor = current->left;
while (predecessor->right != nullptr && predecessor->right != current) {
predecessor = predecessor->right;
}
if (predecessor->right == nullptr) {
predecessor->right = current;
current = current->left;
} else {
predecessor->right = nullptr;
std::cout << current->data << " ";
current = current->right;
}
}
}
}

Preorder Traversal using Morris Traversal

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
void morrisPreorderTraversal(Node* root) {
Node* current = root;
while (current != nullptr) {
if (current->left == nullptr) {
std::cout << current->data << " ";
current = current->right;
} else {
Node* predecessor = current->left;
while (predecessor->right != nullptr && predecessor->right != current) {
predecessor = predecessor->right;
}
if (predecessor->right == nullptr) {
std::cout << current->data << " ";
predecessor->right = current;
current = current->left;
} else {
predecessor->right = nullptr;
current = current->right;
}
}
}
}

Postorder Traversal using Morris Traversal

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
void reverseNodes(Node* start, Node* end) {
if (start == end) return;
Node* x = start;
Node* y = start->right;
Node* z;
while (x != end) {
z = y->right;
y->right = x;
x = y;
y = z;
}
}

void printReverse(Node* start, Node* end) {
reverseNodes(start, end);
Node* current = end;
while (true) {
std::cout << current->data << " ";
if (current == start) break;
current = current->right;
}
reverseNodes(end, start);
}

void morrisPostorderTraversal(Node* root) {
Node dummy;
dummy.left = root;
dummy.right = nullptr;
Node* current = &dummy;
while (current != nullptr) {
if (current->left == nullptr) {
current = current->right;
} else {
Node* predecessor = current->left;
while (predecessor->right != nullptr && predecessor->right != current) {
predecessor = predecessor->right;
}
if (predecessor->right == nullptr) {
predecessor->right = current;
current = current->left;
} else {
printReverse(current->left, predecessor);
predecessor->right = nullptr;
current = current->right;
}
}
}
}

Main Driver Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <iostream>

struct Node {
int data;
Node* left;
Node* right;
Node(int val) : data(val), left(nullptr), right(nullptr) {}
};

// Function prototypes
void morrisInorderTraversal(Node* root);
void morrisPreorderTraversal(Node* root);
void morrisPostorderTraversal(Node* root);

int main() {
// Constructing a sample binary tree
Node* root = new Node(1);
root->left = new Node(2);
root->right = new Node(3);
root->left->left = new Node(4);
root->left->right = new Node(5);

std::cout << "Inorder traversal: ";
morrisInorderTraversal(root);
std::cout << std::endl;

std::cout << "Preorder traversal: ";
morrisPreorderTraversal(root);
std::cout << std::endl;

std::cout << "Postorder traversal: ";
morrisPostorderTraversal(root);
std::cout << std::endl;

// Deallocate memory
delete root->left->right;
delete root->left->left;
delete root->left;
delete root->right;
delete root;

return 0;
}

This main driver code constructs a binary tree, then applies each of the Morris Traversal methods (inorder, preorder, postorder) to print the traversals. Finally, it deallocates the memory allocated for the tree nodes.

Practice

Writing a Comprehensive Self-Paced Roadmap for NLP with research papers

Writing a Comprehensive Self-Paced Roadmap for NLP with research papers, for my personal development.

Prerequisites:

  • Basic understanding of Python programming language

  • Familiarity with Machine and Deep Learning algorithms

  • Knowledge of libraries used in NLP such as Natural Language Toolkit (NLTK), spaCy, Core NLP, Te Blob, PyNLPI, Gensim, Pattern, etc

Text Preprocessing Level

  • Tokenization, Lemmatization, Stemming, Parts of Speech (POS), Stopwords removal, Punctuation removal

  • Understanding that textual data isn’t directly compatible with Machine Learning algorithms, so it needs to be preprocessed before feeding it into our Machine Learning models

  • Research Paper: “A Neural Probabilistic Language Model”

Advanced level Text Cleaning

  • Normalization, Correction of Typos

  • Mapping and Replacement. This involves mapping words to standardized language equivalents

  • Correction of Typos: Written text often contains errors

Research Paper: “A Unified Architecture for Natural Language Processing: Deep Neural Networks with Multitask Learning”

Language Modeling

Text Classification

Deep Learning for NLP

Advanced NLP Concepts

Attention Mechanisms

  • Understanding of attention mechanisms

  • Types of Attention Mechanisms: Scaled-Dot Product Attention Mechanism, Multi-Head Attention Mechanism

  • Research Paper: “Attention is All You Need”

State-of-the-Art NLP Models

NLP Libraries and Frameworks

NLP Projects

  • Text Classification, Sentiment Analysis, Chatbot Development.

  • Hands-on experience with NLP projects

  • Research Paper: “A Dataset for Document Grounded Conversations”.

CORE Computer Science Conference Rankings

Reading others’ work is important for students and academics. It helps make sure our work is unique and keeps us updated on the latest in our field. But time is limited, so we need to be smart about what we read. If we find a paper that directly relates to our work, it’s essential to read it carefully, cite it, and compare our work to it. Don’t judge a paper by where it’s published; great work can be found anywhere.

Knowing which conferences to focus on can make all the difference in a researcher’s journey. 🌐 In that spirit, I’ve compiled a list of CORE computer science conferences along with their rankings. Check out the rankings here to discover the conferences that are shaping the future of our field. 📚💻

Acronym Standard Name Rank
AAAI National Conference of the American Association for Artificial Intelligence A+
AAMAS International Conference on Autonomous Agents and Multiagent Systems A+
ACL Association of Computational Linguistics A+
ACMMM ACM Multimedia Conference A+
ASPLOS Architectural Support for Programming Languages and Operating Systems A+
CAV Computer Aided Verification A+
CCS ACM Conference on Computer and Communications Security A+
CHI International Conference on Human Factors in Computing Systems A+
COLT Annual Conference on Computational Learning Theory A+
CSCL Computer Supported Collaborative Learning A+
DCC IEEE Data Compression Conference A+
DSN International Conference on Dependable Systems A+
EuroCrypt International Conference on the Theory and Application of Cryptographic Techniques A+
FOCS IEEE Symposium on Foundations of Computer Science A+
FOGA Foundations of Genetic Algorithms A+
HPCA IEEE Symposium on High Performance Computer Architecture A+
I3DG ACM-SIGRAPH Interactive 3D Graphics A+
ICAPS International Conference on Automated Planning and Scheduling A+
ICCV IEEE International Conference on Computer Vision A+
ICDE IEEE International Conference on Data Engineering A+
ICDM IEEE International Conference on Data Mining A+
ICFP International Conference on Functional Programming A+
ICIS International Conference on Information Systems A+
ICML International Conference on Machine Learning A+
ICSE International Conference on Software Engineering A+
IJCAI International Joint Conference on Artificial Intelligence A+
IJCAR International Joint Conference on Automated Reasoning A+
INFOCOM Joint Conference of the IEEE Computer and Communications Societies A+
InfoVis IEEE Information Visualization Conference A+
IPSN Information Processing in Sensor Networks A+
ISCA ACM International Symposium on Computer Architecture A+
ISMAR IEEE and ACM International Symposium on Mixed and Augmented Reality A+
ISSAC International. Symposium on Symbolic and Algebraic Computation A+
ISWC IEEE International Symposium on Wearable Computing A+
IWQoS IFIP International Workshop on QoS A+
JCDL ACM Conference on Digital Libraries A+
KR International Conference on Principles of KR & Reasoning A+
LICS IEEE Symposium on Logic in Computer Science A+
MOBICOM ACM International Conferencem on Mobile Computing and Networking A+
NIPS Advances in Neural Information Processing Systems A+
OOPSLA ACM Conference on Object Oriented Programming Systems Languages and Applications A+
OSDI Usenix Symposium on Operating Systems Design and Implementation A+
PERCOM IEEE International Conference on Pervasive Computing and Communications A+
PERVASIVE International Conference on Pervasive Computing A+
PLDI ACM-SIGPLAN Conference on Programming Language Design & Implementation A+
PODC ACM Symposium on Principles of Distributed Computing A+
PODS ACM SIGMOD-SIGACT-SIGART Conferenceon Principles of Database Systems A+
POPL ACM-SIGACT Symposium on Principles of Prog Langs A+
RSS Robotics: Systems and Science A+
RTSS Real Time Systems Symp A+
SENSYS ACM Conference on Embedded Networked Sensor Systems A+
SIGCOMM ACM Conference on Applications, Technologies,Architectures, and Protocols for Computer Communication A+
SIGGRAPH ACM SIG International Conference on Computer Graphics and Interactive Techniques A+
SIGIR ACM International Conference on Research and Development in Information Retrieval A+
SIGKDD ACM International Conference on Knowledge Discovery and Data Mining A+
SIGMETRICS ACM SIG on computer and communications metrics and performance A+
SIGMOD ACM Special Interest Group on Management of Data Conference A+
SODA ACM/SIAM Symposium on Discrete Algorithms A+
SOSP ACM SIGOPS Symposium on Operating Systems Principles A+
STOC ACM Symposium on Theory of Computing A+
UAI Conference in Uncertainty in Artifical Intelligence A+
UbiComp Uniquitous Computing A+
VLDB International Conference on Very Large Databases A+
WWW International World Wide Web Conference A+
ACM-HT ACM Hypertext Conf A
AH International Conference on Adaptive Hypermedia and Adaptive Web-Based Systems A
AID International Conference on AI in Design A
AIED International Conference on Artificial Intelligence in Education A
AIIM Artificial Intelligence in Medicine A
AiML Advances in Modal Logic A
ALENEX Workshop on Algorithm Engineering and Experiments A
ALIFE International Conference on the Simulation and Synthesis of Living Systems A
AMAI Artificial Intelligence and Maths A
AMIA American Medical Informatics Annual Fall Symposium A
AOSD Aspect-Oriented Software Development A
APPROX International Workshop on Approximation Algorithms for Combinatorial Optimization Problems A
ASAP International Conference on Apps for Specific Array Processors A
ASE Automated Software Engineering Conference A
ASIACRYPT International Conference on the Theory and Applications of Cryptology A
ASIS&T Annual conference of American Society for Information Science and Technology A
ATVA International Symposium on Automated Technology for Verification and Analysis A
AVSS Advanced Video and Signal Based Surveillance A
BMVC British Machine Vision Conference A
BPM International Conference in Business Process Management A
CADE International Conference on Automated Deduction A
CAIP International Conference on Computer Analysis of Images and Patterns A
CaiSE International Conference on Advanced Information Systems Engineering A
CANIM Computer Animation A
CASES International Conference on Compilers, Architecture, and Synthesis for Embedded Systems A
CBSE International Symposium Component-Based Software Engineering A
CC International Conference on Compiler Construction A
CCC IEEE Symposium on Computational Complexity A
CCGRID IEEE Symposium on Cluster Computing and the Grid A
CDC IEEE Conference on Decision and Control A
CGI Computer Graphics International A
CGO Code Generation and Optimization A
CIDR Conference on Innovative Data Systems Research A
CIKM ACM International Conference on Information and Knowledge Management A
CLUSTER Cluster Computing Conference A
COCOON International Conference on Computing and Combinatorics A
CogSci Annual Conference of the Cognitive Science Society A
COLING International Conference on Computational Liguistics A
CONCUR International Conference on Concurrency Theory A
CoNLL Conference on Natural Language Learning A
CoopIS International Conference on Cooperative Information Systems A
Coordination International Conference on Coordination Models and Lanuguages A
CP International Conference on Principles & Practice of Constraint Programming A
CPAIOR International Conference on Integration of Artificial Intelligence and Operations Research Techniques in Constraint Programming for Combinatorial Optimization Problems A
CSB IEEE Computational Systems Bioinformatics Conference A
CSCW ACM Conference on Computer Supported Cooperative Work A
CSFW IEEE Computer Security Foundations Workshop A
CSSAC Cognitive Science Society Annual Conference A
CVPR IEEE Conference on Computer Vision and Pattern Recognition A
DAC Design Automation Conf A
DAS International Workshop on Document Analysis Systems A
DASFAA Database Systems for Advanced Applications A
DEXA International Conference on Database and Expert Systems Applications A
DIGRA Digital Games Research Conference A
DISC International Symposium on Distributed Computing (ex WDAG) A
DocEng ACM Symposium on Document Engineering A
DOOD Deductive and Object-Oriented Databases A
DUX Design for User Experience A
EAAI Engineering Applications of Artifical Intelligence A
EASE International Conference on Evaluation and Assessment in Software Engineering A
ECWeb International Conference on Electronic Commerce and Web Technology A
EKAW International Conference on Knowledge Engineering and Knowledge Management A
EMMSAD Exploring Modelling Methods in Systems Analysis and Design A
EMNLP Empirical Methods in Natural Language Processing A
e-science IEEE International Conference on e-science and Grid Computing A
ESEM Internation Symposium on Empirical Software Engineering and Measurement A
FCCM IEEE Symposium on Field Programmable Custom Computing Machines A
FLOPS International Symposium on Functional and Logic Programming A
FODO International Conference on Foundation on Data Organization A
FORTE IFIP Joint Int’l Conference on Formal Description Techniques and Protocol Specification, Testing, And Verification A
FPSAC Formal Power Series and Algebraic Combinatorics A
FSE ACM Conference on the Foundations of Software Engineering (inc ESEC-FSE when held joInternationaly [sic]) A
FSR International Conference on Field and Service Robotics A
FST&TCS Foundations of Software Technology & Theoretical Computer Science A
FUZZ-IEEE IEEE International Conference on Fuzzy Systems A
Grid International Conference on Grid Computing A
Group ACM Special Interest Group on Supporting Group Work (was SIGGRoup) A
HiPC International Conference on High Performance Computing A
HOTCHIPS (HCS) Symposium on High Performance Chips A
HOTNETS ACM Workshop on Hot Topics in Networks A
HotOS USENIX Workshop on Hot Topics in Operating Systems A
HPDC IEEE International Symposium on High Performance Distributed Computing A
Hypertext ACM Conference on Hypertext and Hypermedia A
IC3N International Conference on Computer Communication and Networks A
ICALP International Colloquium on Automata, Languages and Programming A
ICALT IEEE International Conference on Advanced Learning Technologies A
ICARCV International Conference on Control, Automation, Robotics and Vision A
ICC IEEE International Conference on Communications A
ICCAD International Conference on Computer-Aided Design A
ICCL IEEE International Conference on Computer Languages A
ICCS International Conference on Computational Science A
ICCS International Conference on Conceptual Structures A
ICDAR IEEE International Conference on Document Analysis and Recognition A
ICDCS IEEE International Conference on Distributed Computing Systems A
ICDT International Conference on Database Theory A
ICECCS IEEE International Conference on Engineering and Complex Computer Systems A
ICER International Computing Education Research Workshop A
ICGG International Conference on Grid Computing A
ICIAP International Conference on Image Analysis and Processing A
ICIP IEEE International Conference on Image Processing A
ICLP International conference on Logic Programming A
ICMAS International Conference on Multi Agent Systems A
ICNN IEEE International Conference on Neural Networks A
ICNP International Conference on Network Protocols A
ICONIP International Conference on Neural Information Processing A
ICPP International Conference on Parallel Processing A
ICPR International Conference on Pattern Recognition A
ICS ACM International Conference on Supercomputing A
ICSC2 International Computer Symposium Conference A
ICSM International. Conferenceon Software Maintenance A
ICSOC International Conference on Service Oriented Computing A
ICSP International Conference on Software Process A
ICSPC International Conference on Security in Pervasive Computing A
ICSR IEEE International Conference on Software Reuse A
ICTL International Coference on Temporal Logic A
IDA Intelligent Data Analysis A
IEEE-Alife IEEE International Symposium on Artificial Life A
IEEE-CEC Congress on Evolutionary Computation A
IEEE-MM IEEE International Conference on Multimedia Computing and Systems A
IEEETKDE IEEE Transactions on Knowledge and Data Engineering A
IFIP_WG 11.3 IFIP WG 11.3 Working Conference on Data and Applications Security (was IFIP-DBSEC) A
IJCNLP International Joint Conference on Natural Language Processing A
IJCNN IEEE International Joint Conference on Neural Networks A
ILPS International Logic Programming Symposium A
IM IFIP/IEEE Integrated Management (odd years sharing with NOMS) A
IMC Internet Measurement Conference A
INTERACT IFIP International Conference on Human-Computer Interaction A
IPCO MPS Conference on integer programming & combinatorial optimization A
IPDPS IEEE International Parallel and Distributed Processing Symposium (was IPPS and SPDP) A
ISAAC International Symposium on Algorithms and Computation A
ISD International Conference on Information Systems Development A
ISESE International Symposium on Empirical Software Engineering A
ISMB Intelligent Systems in Molecular Biology A
ISR International Symposium on Robotics A
ISSCC IEEE International Solid-State Circuits Conference A
ISSR International Symposium on Robotics Research A
ISSRE International Symposium on Software Reliability Engineering A
ISSTA Internation Symposium on Software Testing and Analysis A
ISTA International Conference on Information Systems Technology and its Application A
ISTCS Israel Symposium on Theory of Computing and Systems A
ISWC International Semantic Web Conference A
ITiCSE Annual Conference on Integrating Technology into Computer Science Education A
ITS International Conference on Intelligent Tutoring Systems A
IUI Intelligent User Interfaces A
IVCNZ Image and Vision Computing Conference A
JICSLP/ICLP/ILPS International Conference/Symposium on Logic Programming (Joint) A
K-CAP Knowledge capture A
LCN IEEE Conference on Local Computer Networks A
LCTES ACM SIGPLAN Conference on Languages, Tools, and Compilers for Embedded Systems A
LPAR Logic Programming and Automated Reasoning A
LPNMR International Conference on Logic Programming and Non-monotonic Reasoning A
MASCOTS Symposium Model Analysis & Simulation of Computer & Telecommunications Systems A
MASS IEEE International Conference on Mobile Ad-hoc and Sensor Systems A
MassPar Symposium on Frontiers of Massively Parallel Processing A
MICRO International Symposium on Microarchitecture A
Middleware ACM/IFIP/USENIX th International Middleware Conference A
MIR ACM SIGMM International Woekshop on Multimedia Information Retrieval A
MMCN ACM/SPIE Multimedia Computing and Networking A
MMSP International Workshop on Multimedia Signal Processing A
MOBIHOC ACM Symposium of mobile and ad hoc computing A
MobileHCI International Conference on Human-Computer Interaction with Mobile Devices and Services A
Mobiquitous International Conference on Mobile and Ubiquitous Systems: Networks and Services A
Mobisys ACM SIGMOBILE International Conference on mobile systems, applications and services A
MODELS International Conference on the Unified Modeling Language (formerly UML) A
MSWIM ACM/IEEE International Conference on Modelling, Analysis and Simulation of Wireless and Mobile Systems A
NAACL North American Association for Computational Linguistics A
NDSS Usenix Networked and Distributed System Security Symposium A
NetStore Network Storage Symposium A
Networking 200X IFIP Networking 200X A
NOSSDAV Network and OS Support for Digital A/V A
NSDI Symposium on Networked Systems, Design and Implementation A
OPENARCH IEEE Conference on Open Architecture and Network Programming A
P2P IEEE International Conference on Peer-toPeer Computing A
PACT International Conference on Parallel Architecture and Compilation Techniques A
PADL Practical Aspects of Declarative Languages A
PADS ACM/IEEE/SCS Workshop on Parallel & Distributed Simulation A
PAKDD Pacific-Asia Conference on Knowledge Discovery and Data Mining A
PDC Participatory Design Conference A
PEPM ACM SIGPLAN Workshop on Partial Evalutation and Program Manipulation A
PERFORMANCE IFIP International Symposium on Computing Performance, Modelling, Measurement and Evaluation A
PG Pacific Graphics A
PPoPP Principles and Practice of Parallel Programming A
PPSN Parallel Problem Solving from Nature A
PRO-VE IFIP Working Conferences on Virtual Enterprises A
PT Performance Tools - International Conference on Model Techniques & Tools for CPE A
QoSA Conference on the Quality of Software Architectures A
QSIC International Quality Software Conference A
RAID Symposium on Recent Advances in Intrusion Detection A
RANDOM International Workshop on Randomization and Computation A
RE IEEE Requirements Engineering A
RECOMB Annual International Conferenceon Comp Molecular Biology A
RoboCup Robot Soccer World Cup A
RST International Conference on Reliable Software Technologies A
RTA International Conference on Rewriting Techniques and Applications A
RTAS IEEE Real-Time and Embedded Technology and Applications Symposium A
S&P IEEE Symposium on Security and Privacy A
SARA Symposium on Abstraction, Reformulation and Approximation A
SAS Static Analysis Symposium A
SAT International Conference on Theory and Applications of Satisfiability Testing A
SCA ACM SIGGRAPH/Eurographics Symposium on Computer Animation A
SCC IEEE International Conference on Services Computing A
SCG ACM Symposium on Computational Geometry A
SCOPES International Workshop on Software and Compilers for Embedded Systems A
SDM SIAM International Conference on Data Mining A
SDSDI Unix Symposium on Operating Systems Design and Implementation A
SIGCSE ACM Special Interest Group on Computer Science Education Conference A
SMS IEEE International Symposium on Software Metrics A
SPAA Symposium on Parallelism in Algorithms and Architectures A
SPICE Software Process Improvement and Capability Determination A
SRDS Symposium on Reliable Distributed Systems A
SSDBM International Conference on Scientific and Statistical Data Base Management A
SSPR Structural and Statistical pattern recognition A
SSR ACM Symposium on Software Reusability A
SSTD International Symposium on Spatial Databases A
STACS Symposium on Theoretical Aspects of Computer Science A
SUPER ACM/IEEE Supercomputing Conference A
SWAT Scandinavian Workshop on Algorithm Theory A
TABLEAUX International Conference on Theorem Proving with Analytic Tableaux and Related Methods A
TACAS Tools and Algorithms for Construction and Analysis of Systems A
TARK Theoretical Aspects of Rationality and Knowledge A
TIME International Symposium on Temporal Representation and Reasoning A
TREC Text Retrieval Conference A
UIST ACM Symposium on User Interface Software and Technology A
UM International Conference on User Modelling A
USENIX USENIX Annual Technical Conference A
USENIX-Security Usenix Security A
USITS Unix Symposium on Internet Technologies A
VCIP SPIE International Conference on Visual Communications and Image Processing A
VIS IEEE Visualization A
VL/HCC IEEE Symposium on Visual Languages and Human-Centric Computing (was VL) A
VLSI IEEE Symposium VLSI Circuits A
VMCAI Verification, Model Checking and Abstract Interpretation A
WACV IEEE Workshop on Apps of Computer Vision A
WADS Workshop on Algorithms and Data Structures A
WICSA EEE/IFIP Working Conference on Software Architecture A
WISE International Conference on Web Information Systems Engineering A
WoWMoM IEEE International Symposium on a World of Wireless, Mobile and Multimedia Networks A
WPHOL International Conference on Theorem Proving in Higher Order Logics A
ANNIE Artificial Neural Networks in Engineering Conference B
APCHI Asia-Pacific Conference on Computer Human Interaction B
CAIA Conference on Artificial Intelligence for Applications B
CCW IEEE Computer Communications Workshop B
CEC/EEE IEEE Conference on Electronic Commerce Technology and Enterprise Computing, e_Commerce and e-Services B
CGA Workshop on Computational Geometry and Applications B
CICLING Conference on Intelligent Text Processing and Computational Linguistics B
CompLife International Symposium on Computational Life Science B
COMPSAC International Computer Software and Applications Conference B
CSL, 2 th Annual Conference on Computer Science Logic B
DCOSS IEEE Conference on Distributed Computing in Sensor Systems B
DMTCS International Conference on Discrete Mathematics and Theoretical Computer Science B
DNA Meeting on DNA Based Computers B
ECBS Annual IEEE International Conference and Workshop on the Engineering of Computer Based Systems B
FOSSACS Foundations of Software Science and Computational Structures B
GECCO Genetic and Evolutionary Computations B
HPCN International Conference on High Performance Computing and Networking B
ICAIL International Conference on Artificial Intelligence and Law B
ICANN International Conference on Artificial Neural Networks B
ICCE International Conference on Computers in Education B
ICCI International Conference on Computing and Information B
ICDCN IEEE International Conference on Distributed Computing and Networking B
ICSC International Computer Science Conference B
ICTAC International Colloquium on Theoretical Ascpects of Computing B
ICTAI IEEE International Conference on Tools with Artificial Intelligence B
IEAAI International Conference on Industrial and Engineering Applications of Artificial Intelligence and Expert Systems B
IJCNLP2 International Joint Conference on Computational Linguistics B
IPCCC IEEE International Performance Computing and Communications Conference B
ISCC IEEE Symposium on Computers & Communications B
ISCIS International Symposium on Computer and Information Sciences B
IWANN International Work-Conference on Artificial and Natural Neural Networks B
IWCMC ACM International Wireless Communications and Mobile Computing Conference B
IWPEC International Workshop on Parameterized and Exact Computation B
JCSC Journal of Computing Science in Colleges (conference proceedings) B
Koli Calling Baltic Sea Conference on Computing Education Research B
LFCS Logical Foundations of Computer Science B
MCU Universal Machines and Computations B
MFCS Mathematical Foundations of Computer Science B
MPCS International Conference on Massively Parallel Computing Systems B
NORDCHI Norwegian Computer Human Interaction B
PACLIC Pacific Asia Conference on Language, Information and Computation B
PACLING Conference of the Pacific Association for Computational Linguistics B
PDCAT International Conference on Parallel and Distributed Computing, Applications and Technologies B
PRICAI Pacific Rim International Conference on Artificial Intelligence B
RTCSA International Conference on Real-Time and Embedded Computing Systems and Applications B
SAC ACM Symposium on Applied Computing B
SAFECOMP International Conference on Computer Safety, Reliability and Security B
SCSC Summer Computer Simulation Conference B
SIGCHI-NZ International NZ Conference on Computer-Human Interaction B
UMC Unconventional Models of Computation B
WAIS International Workshop on Artificial Intelligence and Statistics B
WoLLIC Workshop on Logic, Language, Information and Computation B
AdCom International Conference on Advanced Computing and Communications C
AIA Artificial Intelligence and Applications Conference C
AIL International Conference on Artificial Intelligence and Law C
AISAT International Conference on Artificial Intelligence in Science and Technology C
ANNES Conference on Artificial Neural Networks and Expert systems C
APCOMin Application of Computers and Operations Research in the Minerals Industries C
ASC IASTED International Conference on Artificial Intelligence and Soft Computing C
CAADRIA Conference on Computer Aided Architectural Design Research in Asia C
CAINE ISCA International Conference on Computer Applications in Industry and Engineering C
CATA International Conference on Computers and their Applications C
CATE IASTED International Conference on Computers and Advanced Technology in Education C
CCTAF Intelligent Multimedia, Computing and Communications Technologies and Applications of the Future C
CHPC International Conference on High Performance Computing C
CIBCB IEEE Symposium on Computational Intelligence in Bioinformatics and Computational Biology C
CIMCA International Conference on Computational Intelligence for Modelling, Control and Automation C
COMPDES International Symposium on Computer Design C
CSICC International CSI Computer Conference C
CTAC Computational Techniques and Applications Conference C
GeoComp International Conference on GeoComputation C
HCI International Conference on Human-Computer Interaction C
HealthCom International Workshop on Enterprise Networking and Computing in Health Care Industry C
HPC International Conference and Exhibition on High Performance Computing in the Asia-Pacific Region C
IADIS AC IADIS International Conference Applied Computing C
IC International Conference on Internet Computing C
IC-AI International Conference on Artificial Intelligence C
ICANNGA International Conference on Artificial Neural Networks and Genetic Algorithms C
ICCIMA International Conference on Computational Intelligence and Multimedia Applications C
ICCIT International Conference on Computer and Information Technology C
ICEC IEEE International Conference on Evolutionary Computation C
IICS Innovative Internet Computer Systems C
ISORC IEEE International Symposium on Object-Oriented Real-Time Distributed Computing C
IWCC IEEE International Workshop on Cluster Computing and the Grid C
JHPC Workshop On Java For High-Performance Computing C
LCCS International Workshop on Logic and Complexity in Computer Science C
NCCIS National Conference on Computer and Information Systems C
NeMLaP Joint Conference on New Methods in Language Processing and Computational Natural Language Learning C
NPSC International Conference on Neural, Parallel and Scientific Computations C
PARCO Parallel Computing C
PCW International Parallel Computing Workshop C
PDCN IASTED International Conference on Parallel and Distributed Computing and Networks C
PDCS IASTED International Conference on Parallel and Distributed Computing and Systems C
PSB Pacific Symposium on Biocomputing C
QuantCom International Conference on Experimental Implementation of Quantum Computation C

In addition to directly related papers, it’s important to explore related topics. Venue ranking can help us find high-quality places to look, especially for newer work that hasn’t been cited much yet. A good practice is to check out accepted papers in leading conferences early on. Read the ones close to your research and even those somewhat related. The community knows these papers, and if you don’t cite them or show how your work is different, your submission might face criticism or rejection.

Let’s make this post even more valuable! Share your favorite conferences or tips in the comments below. 🌐💬

Exporting an ONNX Model from Caffe2

Caffe2 supports exporting models directly to ONNX. Here are the steps:

  1. Install Caffe2 by following the instructions provided in the official Caffe2 documentation.

  2. Import the necessary libraries in your Python script:

    1
    2
    from caffe2.python.onnx import backend as caffe2_backend
    import torch.onnx
  3. Load your Caffe2 model into PyTorch:

    1
    2
    # Assuming you already have a Caffe2 model loaded
    torch_model = torch.onnx.load("path/to/caffe2_model.pb")
  4. Export the PyTorch model to ONNX:

    1
    torch.onnx.export(torch_model, torch.randn(1, 3, 224, 224), "path/to/exported_model.onnx", verbose=True)

    Adjust the input shape and replace “path/to/exported_model.onnx” with the desired path to save the ONNX file.

Exporting an ONNX Model from PyTorch

PyTorch provides a straightforward way to export models to the ONNX format. Follow these steps:

  1. Ensure that you have PyTorch installed. You can install it using pip:

    1
    pip install torch
  2. Import the necessary libraries in your Python script:

    1
    2
    import torch
    import torchvision
  3. Load your PyTorch model:

    1
    model = torchvision.models.resnet18(pretrained=True)
  4. Export the model to ONNX:

    1
    torch.onnx.export(model, torch.randn(1, 3, 224, 224), "path/to/exported_model.onnx", export_params=True)

    Make sure to replace “path/to/exported_model.onnx” with the desired path to save the ONNX file.

Exporting an ONNX Model from TensorFlow

To export a TensorFlow model to the ONNX format, you can use the TensorFlow-ONNX converter. Here’s how:

  1. Make sure you have TensorFlow and TensorFlow-ONNX installed. Install them using pip:

    1
    pip install tensorflow tensorflow-onnx
  2. Import the required libraries:

    1
    2
    import tensorflow as tf
    import tf2onnx
  3. Load your TensorFlow model:

    1
    model = tf.keras.applications.ResNet50(weights="imagenet")
  4. Convert the TensorFlow model to ONNX:

    1
    2
    onnx_model, _ = tf2onnx.convert.from_keras(model)
    tf2onnx.save_model(onnx_model, "path/to/exported_model.onnx")

    Replace “path/to/exported_model.onnx” with the desired path to save the ONNX file.

Loading an ONNX Model

After exporting the model from your preferred framework to ONNX, you can load it for inference using the onnx package. Here’s an example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import onnx

# Load the ONNX model
model = onnx.load("path/to/exported_model.onnx")

# Create an ONNX runtime session
import onnxruntime as ort
session = ort.InferenceSession("path/to/exported_model.onnx")

# Perform inference using the loaded model
input_name = session.get_inputs()[0].name
output_name = session.get_outputs()[0].name
input_data = np.random.rand(1, 3, 224, 224).astype(np.float32) # Replace with your actual input data
output = session.run([output_name], {input_name: input_data})

print(output)

Remember to replace “path/to/exported_model.onnx” with the path to your exported ONNX model, and provide appropriate input data for inference.

That’s it! Now you can export models from different frameworks to ONNX and use the ONNX runtime to load and perform inference with those models.

Starting with Hexo

This website is developed using Hexo framework. Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment