This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# age_classification_with_resnet.py | |
import os | |
import argparse | |
import torch | |
import torch.nn as nn | |
import torch.optim as optim | |
from torch.utils.data import DataLoader | |
from torchvision import datasets, models, transforms | |
from sklearn.metrics import classification_report, confusion_matrix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
A refactored, reusable script for training and evaluating a dog age classifier. | |
This script uses a pre-trained ResNet-18 model for transfer learning. | |
It includes functionalities for training, validation, testing, logging, and | |
checkpointing, all controllable via command-line arguments. | |
Example Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""age_classification_with_resnet_18.ipynb | |
Automatically generated by Colab. | |
Original file is located at | |
https://colab.research.google.com/drive/1wIsjO2LhN8fsH0pP8Hy2Ub9bKocK28Vy | |
""" | |
from google.colab import drive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn divide(num: i32) -> i32 { | |
return num/2; | |
} | |
fn main() { | |
println!("Hello, world! {}", divide(10)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.stream.Collectors; | |
public class ApprovalRule { | |
static boolean ifAnySubRuleIsExhausted(String actingRule, String approveForGroup){ | |
System.out.println("Applying approval for group -> " + approveForGroup + " on rule -> " + actingRule); | |
return Arrays.stream(actingRule.split("--")) | |
.map(r -> r.replaceFirst(approveForGroup, "")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RemoveDuplicatesFromSortedArray { | |
public int removeDuplicates(int[] nums) { | |
int uniqueValCount=0, currentVal=nums[0]; | |
for (int i =0; i<nums.length; i++){ | |
if(nums[i]>currentVal){ | |
uniqueValCount++; | |
nums[uniqueValCount]= nums[i]; | |
currentVal = nums[i]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
main() | |
{ | |
printf("hi"); | |
} |